All eyes have been on artificial intelligence (AI) this year, and for good reason. The market hit a value of $137 billion in 2022 and is projected to expand at a compound annual growth rate of 37% through 2030 (per Grand View Research). The sector is expanding quickly, leading numerous tech companies to restructure their business models with a priority on AI. 

Thus, it's not a bad idea to consider adding an AI stock to your portfolio to potentially profit from the market's long-term growth.

Nvidia (NVDA 1.75%) and Amazon (AMZN -0.09%) are two attractive options, with one dominating in chips and the other using its leading position in cloud computing to carve out a lucrative role in AI. Nvidia's and Amazon's stocks have soared 219% and 75% year to date, thanks to increasing prospects in the sector, and could rise further in the new year.

So, let's take a look at whether Nvidia or Amazon is the better stock for investing in AI right now.

Nvidia plays a primary role

Whether you're a casual investor or trade professionally, chances are you're familiar with Nvidia's meteoric rise in 2023. Alongside a soaring stock, the company has posted multiple quarters of impressive earnings as it has snapped up an estimated 90% market share in AI chips.

Graphics processing units (GPUs) are crucial for running and developing AI models, and Nvidia has dominated the GPU market for years, producing some of the industry's highest-powered chips in the industry. So, when interest in AI rose, so did demand for GPUs. Nvidia was perfectly positioned to supply its chips to the entire market while its competitors scrambled to catch up and develop hardware to match the company's performance.

In the third quarter of 2024, Nvidia's revenue skyrocketed 206% year over year, with operating income up more than 1,600%. The spike in earnings came alongside data center revenue that climbed 279%, reflecting a significant increase in AI chip sales.

Nvidia has enjoyed monster growth this year, perhaps the tech company to profit most from the boom in AI so far. The question is whether its earnings have lived up to its bull run or its stock remains overvalued.

Amazon has solid prospects

While Nvidia is excelling in AI hardware, Amazon has solid prospects in the software side of the industry. The retail giant is no stranger to the technology, using AI for years to track shopping trends on its e-commerce site, recommend products to consumers, and improve shipping logistics. However, like many tech companies, Amazon ramped up its expansion in the market this year.

As businesses increasingly seek ways to integrate AI into their workflow, cloud companies are rushing to meet demand for such services. Amazon has an advantage in this area of AI as the home of Amazon Web Services (AWS), the world's largest cloud computing platform.

AWS introduced a wide range of AI tools this year, including Bedrock, a service that helps businesses build generative AI applications. Meanwhile, CodeWhisperer will produce code for developers, and HealthScribe can transcribe a doctor-patient conversation. 

Moreover, AWS announced in June it would soon venture into chip development, which could see it go head-to-head with Nvidia.

Is Nvidia or Amazon the better AI stock?

Nvidia and Amazon have massive potential in AI and likely have critical roles to play in the development of the industry over the long term. However, when comparing the companies' price-to-sales ratios (P/S) (as seen in the chart below), Nvidia looks significantly overvalued, while Amazon shares are trading at a more attractive price point.

AMZN PS Ratio Chart

Data by YCharts. PS Ratio = price-to-sales ratio.

P/S is a valuation metric that takes a company's market cap and divides it by its trailing-12-month revenue. The lower the P/S, the better. By this metric, Amazon shares are a bargain compared to Nvidia.

NVDA Chart

Data by YCharts.

In addition, despite Amazon's rally this year, its share price remains down from a high it achieved in 2021. Comparatively, Nvidia's stock hit a then-high of $330 per share in November of that year but has since flown far past it. The difference could suggest Amazon has more room for growth, with its stock still down 21%.

As a dominant figure in e-commerce and the cloud market, Amazon has massive potential in AI. Its diverse business model will likely present countless opportunities to profit from the industry. Alongside a cheaper stock, Amazon is the better buy.