The list of $1 trillion stocks is fairly exclusive, as only six companies currently hold this title. Of the companies in this club, I'm most excited about Amazon's (AMZN -1.27%) stock potential over the next few years.

Amazon is far more than the e-commerce company many know it as, and this business shift should reward shareholders handsomely over the long run. But why is right now the best time to buy the stock? Read on to find out.

Amazon's most important segments have higher margins than e-commerce

As mentioned before, Amazon has expanded beyond its e-commerce roots. In the second quarter, its revenue makeup by division looks like this:

Segment Revenue YOY Growth Revenue Makeup
Online stores $53 billion 4% 39%
Third-party seller services $32.3 billion 18% 24%
Amazon Web Services (AWS) $22.1 billion 12% 16%
Advertising services $10.7 billion 22% 8%
Subscription services $9.9 billion 14% 7%
Physical stores $5 billion 6% 4%
Other $1.3 billion 26% 1%

Data source: Amazon. YOY = Year over year. Note: Percentages do not add up to 100% due to rounding errors.

As you can see, Amazon's biggest and most prominent segment, online stores, isn't growing that fast. This has been a multi-year trend, but investors shouldn't be disappointed in it. It's being made up for by higher third-party seller services, which are more profitable because Amazon isn't responsible for taking inventory risk.

Tying directly into this rise are Amazon's advertising services, which have been Amazon's biggest growth story (besides the "other" category) for some time. Because Amazon can monetize advertising for its third-party sellers, it makes that business even more profitable.

Perhaps the most surprising business in this table is Amazon Web Services, the company's cloud computing division. AWS is the market leader in cloud computing, but it isn't growing as fast as its competitors. That's because many of AWS' clients are focused on optimizing their spending, and Amazon is willing to help them in order to maintain long-term relationships. Investors shouldn't be too concerned with this temporary trend, as the cloud computing market is expected to expand from $678 billion in 2023 to $2.4 trillion by 2030.

The common theme in all these businesses is that they have higher margins than e-commerce, which will significantly boost profits as Amazon reaches peak profitability. However, Amazon is still working on that.

Thanks to efficiency improvements championed by CEO Andy Jassy, Amazon's operating margins improved over the past few quarters.

Chart showing Amazon's operating margin falling from 2021-2022, then rising.

AMZN Operating Margin (Quarterly) data by YCharts

However, Amazon isn't done yet -- it plans to continue improving its profitability. Still, these improvements helped Amazon's earnings per share (EPS) rise substantially, as Amazon lost $0.20 last year compared to a $0.66 profit this year.

As a result of these improvements, Amazon stock has had a phenomenal year, as it is up around 60%. However, I don't think it's close to being done yet, and I have a key chart showing why.

Multiple expansion could be a catalyst for the stock

A price-to-sales (PS) ratio is the best way to assess this stock's valuation, as its trailing 12-month profits aren't optimized.

Chart showing Amazon's PS ratio and gross profit margin both up in 2023.

AMZN PS Ratio data by YCharts

With the stock trading at 2.6 times sales, it's at a level last seen in 2016 (besides where it entered 2023). However, its gross profit margin has nearly doubled since then, which normally would translate into a higher valuation (because of its greater potential for profits). As a result, Amazon stock will continue to see outsized growth because it will likely experience multiple expansion.

Multiple expansion occurs when investors are willing to pay more for a stock than before, so the stock price rises even if business results are flat. This mechanism caused Apple's stock to rise substantially over the past decade.

With Amazon increasing its profitability and the multiple expansion catalyst, Amazon stock could be slated for even more growth ahead. As a result, I think Amazon is one of the top stocks to buy right now.