A few years ago, it seemed unlikely that Nvidia (NVDA -1.99%) could become as valuable as Amazon (AMZN 0.58%). At the beginning of 2020, Nvidia had an enterprise value of $136 billion while Amazon was worth $889 billion.

But today, Nvidia is worth $1.46 trillion and Amazon is worth $1.60 trillion. Both of those tech giants kept growing over the past four years, but Nvidia closed in on Amazon as the rapid expansion of the artificial intelligence (AI) market lit a raging fire under its data center business.

Could this red-hot chipmaker actually overtake the e-commerce and cloud leader by 2025?

A couple looks at a tablet computer at home.

Image source: Getty Images.

How rapidly did Nvidia grow over the past few years?

Nvidia's revenue declined 7% in fiscal 2020, which ended in January 2020, as it struggled with the slower growth of the PC gaming market, the decline of cryptocurrency prices -- which drove miners to flood the market with secondhand GPUs -- and supply chain disruptions caused by the onset of the COVID-19 pandemic.

But in fiscal 2021, its revenue surged 53% as the gaming and AI markets heated up again. That growth continued over the following year and its revenue soared 61% in fiscal 2022.

In fiscal 2023, its revenue growth flatlined as PC sales dropped in a post-pandemic market and the macro headwinds forced data center operators to rein in their spending. By the end of the year, many analysts expected Nvidia's revenue to grow only about 10% in fiscal 2024. However, those conservative forecasts didn't account for the explosive growth of the generative AI market over the past year -- which drove many companies to accumulate Nvidia's top-tier data center GPUs to process complex AI tasks. That's why the same analysts now expect Nvidia's revenue to soar 119% to $59.1 billion in fiscal 2024 (which finalizes at the end of this month).

If Nvidia matches that target, it will have grown its annual revenue at a compound annual growth rate (CAGR) of 52.5% from fiscal 2020 to fiscal 2024. Amazon is expected to grow its revenue at a CAGR of 19.4% from 2019 to 2023.

Amazon also experienced a boom and bust cycle over the past four years. Its growth initially accelerated during the pandemic as more people shopped online and companies ramped up their spending on cloud-based services, but it slowed down as those tailwinds dissipated. Inflation and rising interest rates exacerbated that slowdown -- but its core e-commerce and cloud businesses have gradually stabilized over the past year.

Nvidia could keep growing faster than Amazon

The bulls believe Nvidia's sales will keep soaring as it sells more data center chips, which made up 80% of its revenue in its latest quarter, and its gaming business grows again. Analysts expect its revenue to grow at a CAGR of 36% from fiscal 2024 to fiscal 2026 as the AI market continues to expand. They also expect its EPS to grow at a CAGR of 38%.

We should take those estimates with a grain of salt since those analysts were largely blindsided by the generative AI boom, but the long-term forecasts for the AI industry reinforce that bullish outlook. The broader AI market could grow at a CAGR of 19% from 2023 to 2032, according to Precedence Research, while Fortune Business Insights believes the generative AI niche will expand at an even faster CAGR of 47.5%.

Nvidia's stock isn't cheap at 33 times next year's earnings, but its dominance of the growing data center and gaming GPU markets could justify that higher valuation. But Nvidia still needs to overcome some unpredictable challenges, including the latest export curbs on advanced AI chips to China; the development of first-party AI chips by major customers such as Amazon, Microsoft, and OpenAI; and a potential supply glut caused by companies accumulating too many data center GPUs.

Yet Nvidia could still grow faster than Amazon, which is expected to grow its revenue and EPS at a CAGR of 12% and 34%, respectively, from 2023 to 2025. And at 43 times next year's earnings, Amazon's stock still looks pricier than Nvidia's.

Nvidia could be worth more than Amazon by 2025

Based on all these facts, Nvidia could easily become more valuable than Amazon by the end of 2025. Its stock would only need to rise about 10% from its current levels to lift its enterprise value past Amazon's, and it could continue to outperform the e-commerce and cloud leader over the next two years as the AI market continues growing.