The artificial intelligence (AI) market has captivated Wall Street during the past year. The launch of OpenAI's ChatGPT reignited interest in the technology and highlighted just how far AI has advanced. AI has huge potential in the coming years as it bolsters industries such as consumer tech, cloud computing, machine learning, autonomous vehicles, and much more.

In fact, data from Grand View Research shows the AI market reached about $200 billion last year and is projected to reach nearly $2 trillion by 2030. So, despite a monster rally for AI stocks last year, it's not too late to invest and benefit from the sector's development over the long term.

Nvidia (NVDA -1.54%) and Amazon (AMZN -3.29%) are two attractive options. One dominates the AI chip market, and the other is a leader in cloud computing, one of the fastest-growing areas of AI.

So, let's compare these companies and determine whether Nvidia or Amazon is the better AI stock right now.

Nvidia

Nvidia became a favorite on Wall Street last year, with its stock up about 225% since last April. The company's hardware became the gold standard in AI graphics processing units (GPUs) in 2023 as developers worldwide loaded up on its chips. As a result, Nvidia achieved an estimated 90% market share in AI GPUs alongside soaring earnings.

In its fiscal fourth quarter ended Jan. 28, the company's revenue increased by 265% year over year to $22 billion. Operating income jumped 983% to nearly $14 billion. This monster growth was primarily due to a 409% increase in data center revenue, reflecting a spike in AI GPU sales.

Additionally, Nvidia's free cash flow was up 430% in the past year to more than $27 billion, significantly higher than rival chipmakers AMD's $1 billion and Intel's negative $14 billion. So, despite new GPU releases from both competitors, Nvidia's head start in AI gave the company an edge, providing it with more significant cash reserves to continue investing in technology and retain market supremacy.

The vast potential of AI indicates that chip demand will continue rising, and Nvidia will likely continue to see major gains from the industry.

Amazon

Amazon became a household name worldwide thanks to the success of its e-commerce site, responsible for 38% of the online retail market. The company's role in the industry is paramount, with Walmart in a distant second place with a 6% share.

However, Amazon's biggest growth catalyst is easily its cloud platform, Amazon Web Services (AWS). In the fourth quarter of 2023, revenue from the platform rose 13% year over year to $24 billion. Meanwhile, AWS was responsible for 54% of the company's operating income despite contributing the smallest portion of revenue among Amazon's three segments.

AWS gives Amazon a lucrative role in AI. As the world's biggest cloud service provider, AWS has the potential to leverage its cloud data centers and steer the generative AI market.

So, it's unsurprising that Amazon is investing heavily in this lucrative sector. In 2023, AWS responded to increased demand for AI services by introducing a variety of new tools. The platform launched Bedrock, a program that helps customers build generative AI applications. It also unveiled CodeWhisperer, which is capable of generating code for developers, and HealthScribe, a tool that can transcribe patient-to-physician conversations.

Meanwhile, Amazon is even using AI to boost its retail site and announced an AI shopping assistant dubbed Rufus ahead of its latest earnings release.

Is Nvidia or Amazon the better AI stock?

Nvidia and Amazon have potent positions in AI that will likely allow them to profit from the industry's tailwinds for years.

However, the data below indicates Amazon's stock is currently trading at a much more appealing valuation.

NVDA PS Ratio Chart

Data by YCharts

This chart shows Nvidia's price-to-sales (P/S) and price-to-free-cash-flow ratios are significantly higher than the same metrics from Amazon.

P/S is calculated by dividing a company's market cap by its trailing-12-month revenue. Meanwhile, price-to-free-cash-flow divides its market cap by free cash flow, which is what's left of cash flow after capital expenditure and operating costs. These are helpful valuation metrics because they consider a company's financial health alongside its share price. For both, the lower the figure, the better the value. And in this case, Amazon's stock is a bargain compared to Nvidia's.

Amazon's free cash flow hit more than $32 billion last year, while Nvidia reached $27 billion. It's not a huge difference, but it does show Amazon is potentially in a better position to keep investing in its AI technology and overcome potential headwinds.

Amazon is a tech behemoth on its way to becoming a major threat in AI. It's also a better-valued stock, making Amazon a no-brainer over Nvidia and a screaming buy right now.