IBM (IBM -1.05%) and Microsoft (MSFT 1.82%) are both blue-chip tech stocks, but they went in different directions over the past 10 years. IBM's shares rose just 10% as the sluggish growth of its legacy businesses offset its burgeoning cloud division. Microsoft's stock skyrocketed 986% as it successfully expanded its mobile, cloud, AI, and gaming segments.

When we look at those growth trajectories, we might assume that Microsoft is still a better overall investment than IBM. However, past performance is a poor indicator of future gains, and IBM is showing flickers of life again as its revenue growth stabilizes. Over the past month, IBM's share prices jumped 16%, while Microsoft's stock climbed 11%.

Five people stand behind a cardboard cutout of a cloud.

Image source: Getty Images.

Both companies recently impressed investors with their latest earnings reports, but could IBM's lower valuation and turnaround potential actually make it a better buy than Microsoft? Let's take a fresh look at both tech giants to decide.

IBM is slowing turning around its business

From 2014 to 2021, IBM's annual revenue dropped from $92.8 billion to $57.4 billion. That precipitous decline was caused by the sluggish growth of its business software, hardware, and IT services segments; its inability to expand in the booming cloud market; and a series of big divestments aimed at raising fresh cash and streamlining the company. IBM also relied too much on wasteful stock buybacks to boost its earnings per share.

But after IBM's cloud chief, Arvind Krishna, became its CEO in 2020, it made three sweeping changes. First, it spun off its slow-growth managed infrastructure services unit as Kyndryl in November 2021. Second, it developed more hybrid cloud and AI services that could be positioned between private and public clouds. That strategy enabled it to profit from the growth of the cloud market without going toe-to-toe against public cloud leaders like Amazon and Microsoft.

Finally, IBM restructured its business into three simpler units (software, consulting, and infrastructure) and set a goal for generating "sustainable mid-single digit revenue growth" from 2022 to 2024. Its revenue rose 6% in 2022 and 2% in 2023, and analysts expect its revenue and adjusted EPS to increase 3% and 5%, respectively, in 2024.

Those stable growth rates indicate IBM's turnaround efforts are paying off, but its stock still trades at 19 times forward earnings and pays a forward yield of 3.6%. That low valuation and high yield are turning Big Blue into a safe-haven stock again -- and that reputation might just help it outperform the market this year if interest rates stay elevated.

Microsoft is still firing on all cylinders

From fiscal 2013 to fiscal 2023 (which ended last June), Microsoft's revenue increased at a compound annual growth rate (CAGR) of 11%, from $77.8 billion to $211.9 billion. That growth can mainly be attributed to Satya Nadella, the company's former cloud chief who became its CEO in February 2014 and guided its transformation into a "mobile first, cloud first" business.

Under Nadella, Microsoft expanded Azure into the world's second-largest cloud infrastructure platform after Amazon Web Services (AWS), transformed most of its desktop software into stickier cloud-based services, developed iOS and Android versions of its apps, and beefed up its Xbox gaming business with the acquisitions of several major publishers and the development of its Game Pass and Cloud Gaming platforms. It also abandoned its struggling Windows Phone segment and created new Surface devices to spark the development of more innovative Windows PCs.

Over the past five years, Microsoft ramped up its investments in OpenAI, the developer of ChatGPT, and integrated the start-up's generative AI tools into its own cloud services. That forward-thinking strategy enabled it to profit from the explosive growth of the generative AI market and drew more customers to its cloud-based ecosystem.

Analysts expect Microsoft's revenue and earnings to increase 15% and 19%, respectively, in fiscal 2024. Those growth rates are impressive, but its stock isn't cheap at 36 times forward earnings, and its forward dividend yield of 0.7% won't attract any serious income investors. Simply put, the market is still valuing Microsoft as a high-growth AI stock, but it could lose its luster if its cloud segment cools off or the macro situation worsens.

The stock better buy: IBM

IBM and Microsoft are both solid long-term investments. IBM is becoming a reliable value play again, while Microsoft is still a great way to capitalize on the growth in the cloud, AI, and gaming markets. But looking ahead, I believe IBM will outperform Microsoft through at least the end of this year as unpredictable interest rates and concerns about a brewing AI bubble drive investors toward cheaper and higher-yielding tech stocks again.