After years of drifting in the hinterlands, IBM finally seems to be coming back to life.

Big Blue delighted investors with its fourth-quarter earnings report, and the stock finished Thursday's session up 9.5%. IBM stock also closed at its highest level in more than 10 years on the news.

Shares of the tech giant are now up roughly 40% in the last three months as investors seem to believe it will be a beneficiary of the artificial intelligence (AI) boom that began with the launch of ChatGPT in late 2022. IBM's fourth-quarter numbers weren't particularly impressive, but managed to overcome modest guidance.

Revenue rose 4% to $17.4 billion, which edged out estimates of $17.3 billion. On the bottom line, adjusted earnings per share increased from $3.60 to $3.87, ahead of the consensus at $3.78.

CEO Arvind Krishna said the company grew revenue in all three of its business segments. Growth was driven by AI and hybrid cloud offerings, and sales orders related to Watsonx and generative AI roughly doubled from the third to fourth quarters.

Guidance for 2024 was also better than expected as the company called for mid-single-digit constant currency revenue growth and free cash flow of $12 billion, up from $11.2 billion in 2023. While those numbers and commentary might sound promising, there's a similar company investors should consider if they're looking for exposure to AI.

An AI robot holds a tablet with a stock chart going up.

Image source: Getty Images.

A better legacy AI play

AI has been propelling both old and new tech stocks higher, and arguably, one of the biggest winners so far has been Oracle (ORCL 2.02%). Oracle is best known for its database software, which has become more valuable in the AI era as the kind of large language models running ChatGPT require massive amounts of data and computing power.

Consequently, Oracle has seen tremendous demand for its cloud infrastructure and cloud software services. In its most recent quarter, cloud infrastructure revenue jumped 52% to $1.6 billion, and overall cloud revenue rose 25% to $4.8 billion.

Oracle has partnered with Microsoft Azure, the cloud infrastructure service, and is ramping up its data centers at an unprecedented pace, expanding 66 of them and building 100 new ones. Chairman and Chief Technology Officer Larry Ellison said, "Demand is over the moon," explaining that the company is building data centers as fast as possible to meet demand. Oracle's remaining performance obligation, a proxy for backlog, is now more than $65 billion, or more than five quarters' worth of revenue.

Oracle's overall revenue growth was similar to IBM's at 5% in its most recent quarter, as its legacy on-premise business has been a drag on growth. Its future, however, is squarely in the cloud, and generative AI has led to a surge in growth at Oracle in a way IBM doesn't seem to be experiencing.

IBM versus Oracle: Head to head

IBM and Oracle posted similar revenue growth in their most recent quarters, and earnings per share was also up by a similar amount: 11% at Oracle on an adjusted basis and 8% at IBM, also adjusted. Even their valuations are similar, as Oracle trades at a price-to-earnings ratio of 21, compared to IBM's at 20. Both companies also have similar pedigrees in legacy tech, though IBM is much older and has a substantial consulting business.

In terms of stock performance, Oracle has been the clear winner over IBM in any reasonable time frame. With regard to AI, IBM looked like an early winner with Watson but struggled to monetize the advanced technology. While IBM now appears to be capitalizing on it, Oracle seems to have a more promising opportunity in AI, considering its massive data center ramp.

IBM's lost decade may finally be over, but investors should consider Oracle instead. The legacy tech giant trades at a similar valuation with a better track record and more promising AI prospects.