Computers and soft drinks don't have a lot in common, but both IBM (NYSE:IBM) and Coca-Cola (NYSE:KO) are in similar situations on the business side of things.

Both companies are currently undergoing major transformations to position themselves for long-term growth. IBM has fallen way behind other tech giants in the fast-growing cloud market. Meanwhile, Coke has faced its own set of challenges with politicos and consumers turning against sugary sodas, which has made growth difficult to come by in recent years.

We'll run down each company's strategy, capital returns, and valuation to determine which of the two stocks investors should buy today.

Big Blue has been slow to catch up

IBM has underperformed the broader market for the last seven years as the company scrambles to keep up with nimble competitors. While Amazon.com and other tech leaders have run away with the cloud market, Big Blue has had to shed slower-growing, less profitable legacy hardware businesses while shifting toward faster-growing areas like security, cloud, data analytics, and blockchain -- what management refers to as "strategic imperatives." 

A man and woman standing in an aisle of large computer servers with a web of bright blue dots overlaying the servers the woman is point to.

IMAGE SOURCE: GETTY IMAGES.

The latest big development was the announced acquisition in late October of enterprise software provider Red Hat for $34 billion. Management expects the deal to accelerate revenue growth, margin expansion, and free cash flow within 12 months of closing. 

While top-line growth has been nothing to be excited about, IBM's strategic imperatives revenue grew 13% in the last quarter, and it now makes up half of total revenue. Given that IBM is so massive, with $80 billion in annual revenue, this transition may take a while before investors see significantly improved growth, but the acquisition of Red Hat may help.

Nonetheless, analysts currently expect flattish growth on both the top and bottom lines this year, and next, for Big Blue. 

The total beverage company

Sugary sodas have fallen out of favor with many consumers, which has made growth difficult to come by over the last decade for the beverage giant. To compensate, Coke has expanded into non-soda categories, such as tea, coffee, and juices, to find growth. 

A young woman and young man giving cheers to each other while holding bottles of Coke.

IMAGE SOURCE: COCA-COLA.

Coke announced in August that it would acquire Costa, a coffee company based in the U.K., for $5.1 billion. Energy drinks could also be a growth opportunity. Coke has had a distribution agreement with Monster Beverage, but the company may launch its own Coca-Cola branded energy drink, according to reports.

Additionally, management has refranchised its bottling operations and has focused on producing lower-calorie beverages and smaller package sizes. These moves are expected to reduce costs and lift margins over time.

So far, the company's strategy seems to be working. Adjusted revenue has accelerated this year to the mid-single-digit range, and operating margin expanded six percentage points in the third quarter. Analysts expect Coke to post earnings per share of $2.08 for 2018, representing growth of 8.9% over last year. 

Dividends

Neither IBM nor Coke is going to make Fortune's fastest-growing companies list, but both companies are very well established in their respective markets. One of the most appealing characteristics of both companies are the generous capital returns to shareholders.

Big Blue recently raised its quarterly payout to $1.57 per share, marking the 23rd straight year it has raised its dividend. The company has paid a dividend for 103 consecutive years.

Coke's quarterly payout is currently $0.39 per share. The company has paid a dividend every year since 1920 and has increased the dividend for 55 straight years. 

Currently, IBM has a higher dividend yield, at 5.2%, while Coke's yield is 3.2%. IBM's higher yield looks even better when looking at the percentage of free cash flow each company pays out as dividends each year.

This table shows IBM's and Coke's payout ratios as a percentage of free cash flow:

Payout Ratio as a % of Free Cash Flow IBM Coke
TTM through Q3 2018 44.2% 124.3%
2017 42.5% 118.8%
2016 40.1% 92.5%
2015 37.4% 71.9%

Data sources: IBM and Coca-Cola. TTM = trailing 12 month. 

As you can see, IBM not only has a higher dividend yield, it also pays out less than half of its annual free cash flow in the form of dividends. Because of this, Big Blue has ample room to raise its dividend going forward.

Keep in mind that the acquisition of Red Hat could potentially put pressure on IBM's ability to pay generous dividends, as my colleague Leo Sun previously discussed. But given the company's relatively low payout ratio as a percentage of free cash flow, and since management assured investors that the Red Hat acquisition will support a growing dividend, I'm willing to give IBM the benefit of the doubt for now.

On the other hand, Coke is currently paying out more than 100% of its annual free cash flow as dividends, which is not sustainable. That percentage has been getting higher in recent years, which could severely limit the company's ability to grow its dividend going forward.

Which is the better buy?

Based on its higher yield and lower payout ratio, IBM is the better dividend stock, and it also trades at a much cheaper forward P/E of just 8.6 times next year's earnings estimates. 

On the other side, Coke trades at a higher forward P/E of 22 times next year's earnings estimates, which looks expensive given the company's single-digit growth.

Although Coke is growing earnings faster, IBM could be significantly undervalued at current prices, although there are risks. IBM has been trying to accelerate its growth for years and hasn't managed to do that yet. The company has a minuscule share of the cloud market, but it still posted growth in its cloud business of 20% in the third quarter. 

As Big Blue's strategic imperatives revenue becomes a larger contributor to the company's top line, the company should get back on a growth track. At such a cheap valuation, any hint of sustained growth would send IBM's share price higher.

While shareholders wait for Big Blue's transformation to take hold, they are getting paid a generous dividend yield of more than 5%, which should make the wait worthwhile.

In my view, IBM is the better buy.

John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. John Ballard has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Amazon and Monster Beverage. The Motley Fool has a disclosure policy.