Stocks in the semiconductor sector have been among the most sought-after investments over the past few years, as demand for artificial intelligence (AI) processors has surged. Two companies that have benefited from the trend are semiconductor manufacturing equipment maker ASML Holdings (ASML 3.04%) and chip designer Nvidia (NVDA 2.05%).
Both could continue to benefit from heavy spending on AI infrastructure, which is forecast to reach between $3 trillion and $4 trillion over the next five years. But which one looks like the better AI stock to buy now and hold for the long term?
Image source: Getty Images.
Nvidia's AI dominance
Nvidia's ability to meet the soaring demand for powerful parallel processors propelled the company's market capitalization from approximately $364 billion at the end of 2022 to around $4.3 trillion today. Its dominance in the AI semiconductor market has led to skyrocketing revenue and earnings.
In its fiscal 2025 (which ended Jan. 26, 2025), Nvidia's sales rose by 114% to $130.5 billion, and its diluted earnings per share (EPS) jumped 130% to $2.99. And the good times are still rolling for Nvidia. Its revenue increased by 62% in its fiscal 2026 third quarter to $57 billion, and EPS popped by 67% to $1.30.
The chipmaker's ability to grow sales and earnings so quickly stems from its estimated 90% share of the data center GPU market. The company's chip designs are superior to competitors' at AI processing, leaving tech giants clamoring for its most advanced semiconductors.

NASDAQ: NVDA
Key Data Points
Moreover, the AI chip market's growth will have more drivers than chatbots from OpenAI and Alphabet. Tech companies are increasingly betting on robotics, self-driving vehicles, and other autonomous systems that will also require advanced AI processors. Consider that Morgan Stanley estimates the humanoid robotics market could be worth $5 trillion by 2050.
As these other markets begin to take shape, it could fuel further sales growth for Nvidia's processors.
ASML benefits from demand for Nvidia's processors
ASML makes some of the key equipment required to manufacture AI processors, which it sells to foundry operators like Taiwan Semiconductor, which in turn churn out the semiconductors designed by clients like Nvidia. This part of the supply chain has boomed lately, and ASML's shares are up 52% over the past year.
ASML enjoys an enviable position in the AI chip manufacturing equipment space, holding an estimated 90% market share in lithography. That's impressive enough, and research from Morningstar indicates that ASML's technology is a decade ahead of its rivals. When it comes to making the most advanced chips, its machines hold a technological monopoly, because no peer offers similarly capable options.
The company also benefits from the fact that it services the machines it sells, providing it with potentially decades of recurring revenue for each machine. ASML's service revenue rose 39% in the first nine months of this year to 6 billion euros, and more growth is expected on that front as it sells more equipment that could remain in use for up to 30 years.

NASDAQ: ASML
Key Data Points
While there are some concerns about the possibility that the AI market may be in a bubble, it's important to note that ASML, like Nvidia, is highly profitable. The company's gross margins hover in the low 50% range, and in the first nine months of this year, its diluted earnings per share were $17.38 -- a 40% increase from the same period in 2024.
Why Nvidia has a slight edge over ASML
I think both of these AI stocks deserve a place in most people's portfolios, but Nvidia gets the win in this matchup because its shares are cheaper than ASML's. Nvidia's stock trades at a price-to-earnings ratio of just 23 right now, compared to ASML's P/E ratio of 34. It's worth noting, though, that both are well below the tech sector's average P/E ratio of 45.
And while Nvidia does get my vote, you probably couldn't go wrong buying either stock and holding onto it for years to come.