Amazon (AMZN 0.29%) has been a stellar performing stock over the past few years, and its growth trajectory has taken it to a $2.37 trillion valuation at the time of this writing. Still, some investors believe there is significant upside in Amazon's stock, and that it could reach a $5 trillion market capitalization by the end of 2030.

That's a 111% gain from today's levels, which would likely be a market-crushing return over the five-and-a-half-year assessment period. So, is the $5 trillion level a dream or an actual possibility? Let's take a look.

A group of people huddled around a computer, smiling.

Image source: Getty Images.

Amazon's most important segments aren't the ones most investors interact with

Almost everyone you know is likely a regular client of Amazon's online store. It has nearly every product under the sun and offers incredibly fast delivery for Prime members. However, the commercial side of the business isn't something investors should get overly excited about.

In Q1, online stores and third-party seller services grew revenue at a 5% and 6% pace, respectively. That's not market-beating growth, but it shouldn't come as a surprise, considering how mature this segment of Amazon's business is.

Instead, I'd urge investors to look beyond the most obvious parts of Amazon's business and focus on some of its most promising segments: Amazon Web Services (AWS) and advertising.

AWS is Amazon's cloud computing wing, and has been a huge beneficiary of two major trends: the general shift from on-premises workloads to the cloud, and AI workloads. Both trends have driven strong growth across the entire cloud computing industry, and this is evident in AWS's results.

In Q1, AWS's revenue rose 17% year over year, with operating income increasing at a 23% pace. One key note about AWS is that its operating margins are far superior to those of the commerce business. In Q1, AWS delivered an impressive 39% operating margin. This superior margin profile enables AWS to contribute a significant portion of Amazon's profits, as it generated 63% of Amazon's operating profits despite accounting for only 19% of total sales. Therefore, there is still significant growth ahead for AWS, and AWS's success is a crucial part of Amazon's journey to a $5 trillion market capitalization.

Advertising services are another key part of Amazon. In Q1, this was the fastest-growing segment for Amazon, with revenue rising 18% year over year. Unfortunately, Amazon doesn't break out the margin profile like it does with AWS, so investors have to make assumptions about the margins. Considering that advertising-focused companies like Meta Platforms consistently deliver operating margins of anywhere from high-30% to low-40%, it's reasonable to surmise that Amazon's ad business would deliver about the same operating margins.

With Amazon possessing some of the most valuable advertising information available on the market, I expect this segment to continue its rapid growth over the next few years, helping to push Amazon toward the $5 trillion threshold.

But will the growth of these two business units be enough?

AWS and advertising will lead Amazon to a $5 trillion valuation

Valuing Amazon based on its price-to-earnings (P/E) ratio can be tricky, as it has significant investments in other companies that can impact its earnings on paper. Instead, I'll use the price-to-operating income ratio to provide a more accurate picture of Amazon's valuation.

Currently, Amazon's stock trades at 33.1 times its operating income. Given the current high market valuation, let's adjust the long-term valuation to 25 times operating income. This would require Amazon to produce $200 billion in operating income by the end of 2030 to achieve the $5 trillion valuation. Considering it produced $72 billion over the past 12 months, this would be huge growth.

If AWS and advertising can each deliver a compounded annual growth rate of 15% over the next five and a half years, this will result in trailing-12-month revenue totals of $241 billion and $126 billion, respectively. If each can deliver a 40% operating margin, that would generate $147 billion in operating income from these two segments alone. That would require the rest of Amazon's business to generate an extra $53 billion in operating income, which seems doable.

As a result, I think Amazon can achieve a $5 trillion valuation by the end of 2025, making the stock an excellent one to purchase today.