2018 was a tough year for digital memory manufacturers, and investors in Seagate Technology (NASDAQ:STX) and Western Digital (NASDAQ:WDC) were no exception. In the last trailing-12-month stretch, Seagate is down 20%, and Western Digital is down 48%.

A slowdown in demand for memory products toward the end of the year is to blame, and a rebound isn't expected until later in 2019. Nevertheless, these two stocks look mighty cheap, and both pay out generous dividends. One looks like a better deal, though, as needs for digital memory continue to grow and evolve.

Metric

Seagate Technology

Western Digital

Market cap

$12.7 billion

$13.1 billion

TTM price to earnings

8.9

16.7

Forward price to earnings

8.7

8.1

Price to free cash flow

6.3

6.5

Dividend yield

5.9%

4.7%

TTM = trailing 12 months. Data source: YCharts and Yahoo! Finance.

Still on the rise...for now

Through Seagate's fiscal 2019 first quarter (which ended September 28, 2018), the company was still reporting rising sales. Revenue was up 14% year over year, and gross profit margin on sales increased to 30.5% from 28% in the year prior. As a result, free cash flow (money left over after basic operations and capital expenditures) continued to rise in spite of the stock's decline over the last year, leaving shares trading at a cheap 6.3 times free cash generation.

Management said it expected industrywide weakness to finally catch up during the second quarter, though, with sales falling about 7% and gross margin declining toward the bottom of the company's long-term guidance of 29% to 33%. It's a gentle decline, and much of that is due to Seagate's focus on older hard-disk memory (over 90% of sales) and lower exposure to more volatile NAND memory like some of its peers (Western Digital included).

Thus, Seagate is experiencing less downward pressure than its peers, although the company is expanding into the wild up-and-down world of NAND memory to keep up with the times. Nevertheless, for now, Seagate looks like a much more stable play and pays out a 5.9% dividend yield.

An artist's illustration of data, with various charts being shared around the globe

Image source: Getty Images.

A bad, bad, not-good year for NAND

Western Digital is also a leading maker of hard drives, like Seagate. However, the company has a much higher exposure to volatile NAND chips, which accounted for half of sales during the company's fiscal 2019 second quarter (which ended December 28, 2018). Sales fell 21% year over year, and total gross profit margins fell to 31.3% from 43.2% the same period the year prior.

That explains Western Digital's steeper declines in the last year, although growth should snap back faster when the NAND market eventually recovers. Thus the company's 12-month forward price-to-earnings (P/E) ratio of 8.1 compared with its trailing P/E of 16.7. Price to free cash flow also prices Western Digital at a mere 6.5 -- making the stock a good deal should revenue and profit margins show signs of recovering soon.

The expectation is that sales will bottom out during the second half of 2019, but steep declines in profits between then and now could put Western Digital's 4.7% yielding dividend at risk. That's because free cash flow (from which dividends are paid) fell to just $24 million last quarter, down from $553 million a year ago. The company had $4.0 billion in cash on the balance sheet to end the year, but a memory-chip slump that lasts longer than expected could put the investor payday at risk.

The better buy is...

Western Digital's stock could rebound in a big way when the digital memory industry eventually turns a corner, but the company's sales are volatile. Business could always get worse, and the slump may last longer than expected, making the stock susceptible to further declines.

Seagate, on the other hand, is a more slow-and-steady play on the memory chip industry. Although its upside could be limited as its portfolio of products is older technology, its dividend is a safer bet, and the company is slowly increasing its presence in the NAND market to capture future growth. Seagate is the better buy right now, while I would recommend buying Western Digital stock in small batches over time to mitigate the wild ride.

Nicholas Rossolillo and his clients have no position in any of the stocks mentioned. The Motley Fool is short shares of Western Digital. The Motley Fool has a disclosure policy.