Interest in artificial intelligence (AI) has soared since the debut of OpenAI's ChatGPT last November. The platform forced the public to rethink what is currently possible with AI and has attracted countless companies to the market. As a result, AI stocks have been on the rise this year, boosting the market into recovery mode after last year's sell-off.

Despite the rally, it's not too late to invest in the high-growth sector and profit from the long-term development of AI. Amazon (AMZN -0.56%) and Nvidia (NVDA -1.41%) are two attractive options. One has the advantage of being the world's biggest cloud company, while the other holds a majority market share in AI chips.

So, let's examine whether Amazon or Nvidia is the better stock to back the $137 billion AI market.

Amazon

Amazon shares have risen 58% since Jan. 1, rallying investors with increasing potential in AI. The company appeared to start the year at a disadvantage as its biggest competitor, Microsoft, acquired exclusive licenses on some of OpenAI's most powerful AI models. However, in recent months, Amazon has used its vast resources to invest heavily in the industry and has shown it shouldn't be underestimated.

The tech giant is using its leading cloud market share to its advantage by swiftly expanding Amazon Web Services (AWS). In June, the company unveiled several new AI-enabled services to AWS. Bedrock uses a language model similar to ChatGPT to help clients build chatbots and image generators. Meanwhile, CodeWhisperer and HealthScribe are tools geared toward web developers and healthcare providers.

According to Reuters, the new AI offerings are attracting thousands of customers, with Sony and Ryanair reportedly testing Bedrock.

Moreover, Amazon CEO Andy Jassy revealed last month that the company has developed two AI chips it calls Inferentia and Trainium. Amazon has promised to offer the best price-to-performance in the market, which could give chipmakers like Nvidia and Advanced Micro Devices a run for their money over the long term.

Nvidia

Nvidia has become a star amid the AI boom, snapping up about 90% of the market share in chips. Its stock has risen 214% year to date as bullish investors have rushed to back the company's potential in the lucrative market.

Investor excitement hasn't been unfounded, as proven by the glowing second-quarter 2024 (July 2023) earnings results. The quarter saw Nvidia revenue rise 101% year over year, beating analysts' expectations by over $2 billion. A rise in AI chip demand was the main driver of growth, with the company projecting an even larger revenue increase in its current quarter as it overcomes supply strains quicker than expected.

Nvidia's data center business has exploded thanks to AI, with the company's years of dominance in graphics processing units (GPU) perfectly positioning it to rule the market. The company could face challenges over the long term as the competition catches up. But until then, Nvidia's command of the sector makes its stock a compelling option.

Is Amazon or Nvidia the better stock to invest in AI?

Amazon and Nvidia have soared to the top in AI this year, becoming among the best ways to invest in the rapidly developing market. However, Nvidia's meteoric stock growth means much of its short-term potential is already priced into its shares, making its current position an expensive option. Meanwhile, Amazon's stock remains 29% down from its all-time high in July 2021, suggesting it has more room to rise.

Additionally, Amazon's position as the leader of the cloud market and its recent venture into chips grant it a more diversified role in AI. The company has the brand recognition and vast resources to attract big names to its AI offerings, which could make it a true threat to Nvidia and others in the market. Meanwhile, Amazon's business as a whole appears to be on a growth path after reporting significant improvements in its e-commerce business in Q2 2023.

As a result, Amazon is the better stock to invest in AI and an excellent long-term investment.