Artificial intelligence (AI) infrastructure spending is booming, and two of the companies with leading chips in this field are Nvidia (NVDA 1.97%) with its graphics processing units (GPUs) and Alphabet (GOOGL 2.05%) (GOOG 2.17%) with its Tensor Processing Units (TPUs). The success of both is undeniable, as they are the two largest companies in the world by market cap as of this writing.
Let's examine both AI stocks to see which one looks like the better one to own over the next five years.
Image source: The Motley Fool.
Nvidia: The AI infrastructure king
Nvidia has been the biggest winner of the AI infrastructure boom thus far, and it remains incredibly well positioned for the future. The company has created a wide moat in AI model training through its CUDA software platform, as most early foundational AI code was written on its software and optimized for its chips. Given this, its dominant position in this market is unlikely to be seriously tested.
The growth it has seen as a result of this has just been staggering. For its first quarter of fiscal year 2027 (ended April 2026), Nvidia grew its revenue by a robust 85% to $81.6 billion. What is even more impressive is that its revenue has grown by more than 11 times in the past three years, from $7.2 billion in fiscal Q1 2024. While its GPUs have led the way with this growth, its data center networking business has actually been its fastest-growing product line, with revenue nearly tripling last quarter to $15 billion.

NASDAQ: NVDA
Key Data Points
Nvidia hasn't been sitting still, and that is one of the big reasons why the company is so well positioned for the future. Seeing the rise of the market for inference, the company smartly "acquired" Groq, whose chips are nicely designed to handle the decode phase of inference. In addition, it has also designed its own Arm-based central processing units (CPUs) to help handle agentic AI. Together with its robust networking portfolio and CUDA ecosystem, it can now offer end-to-end server solutions to handle specific AI tasks, including training, inference, and agentic AI.
Nvidia is no longer just a GPU designer; it is now a complete AI infrastructure player.
Alphabet: The complete AI company
Alphabet is obviously much more than a chipmaker; the company is best known for its Google search engine. However, it is its custom TPU AI accelerators that have given the company a big advantage in the AI race.
TPUs are ASICs (application-specific integrated circuits), which are hardwired chips designed to handle specific tasks. They cannot be reprogrammed like GPUs, but they can offer strong performance at a lower cost and tend to be more energy efficient. Alphabet developed its TPUs with the help of Broadcom more than a decade ago and has optimized its entire hardware and software stack around them.

NASDAQ: GOOGL
Key Data Points
Alphabet is benefiting from its TPUs in a few ways. The first is that they offer a significant cost advantage over competitors that rely on Nvidia's GPUs for both AI model training and inference. Second, it gives the company a cost edge in its cloud computing segment, where it can also offer customers not only Nvidia GPU-powered infrastructure but also cheaper TPU-powered offerings that carry higher margins. Finally, Alphabet has also let a few select customers, most notably Anthropic, purchase its TPUs directly from Broadcom for deployment within and outside Google Cloud, giving it a new high-margin revenue stream.
The verdict
Whether Nvidia or Alphabet stock outperforms over the next five years could largely depend on how high AI infrastructure spending soars. While Nvidia is starting to see more legitimate competitors in areas like inference, I think it still takes a big share of the pie. Meanwhile, at a forward P/E of 16 times for fiscal 2028 (ending January 2028), the stock is relatively cheap.
However, Alphabet has an advantage with a complete AI stack, and if AI infrastructure overspending occurs, it can rent it to others or use it internally. Also, if AI infrastructure spending moderates, it is likely to be a winner because it has been one of the big spenders, and reducing capital expenditures (capex) will boost its free cash flow.
I like both stocks here, but I think Alphabet probably has a more durable model and could be a winner if AI capex moderates, giving it a slight edge.





