Shopify's (SHOP -2.37%) e-commerce tools enable businesses to open their own online stores, process payments, fulfill orders, and manage their own marketing campaigns without relying on massive marketplaces like Amazon (AMZN -1.64%).

Shopify's decentralized strategy enabled it to grow faster than Amazon over the past few years. Between 2015 and 2020, Shopify's annual revenue increased at a whopping compound annual growth rate (CAGR) of 70.2%. Amazon's revenue grew at a CAGR of 29.3% during the same period.

Shopify's stock surged 4,460% over the past five years, while Amazon's stock rose nearly 400%. Yet Shopify's market cap of $182 billion is still less than a tenth of Amazon's market cap of $1.86 trillion.

A small forklift, delivery van, and airplane placed on an open laptop.

Image source: Getty Images.

But if we gaze 10 years into the future, could Shopify's market cap eventually match -- or even surpass -- Amazon's? Let's take a closer look at these two e-commerce giants to find out.

Shopify could still have a lot of room to grow

Shopify serves over 1.7 million businesses worldwide today. That's more than a tenfold jump from its 162,261 merchants in the first quarter of 2015.

That growth is impressive, but it could just be the beginning. Last June, Piper Sandler analyst Brent Bracelin estimated that Shopify's merchants had only penetrated 2% of the e-commerce market.

Bracelin noted that as e-commerce penetration rates rise from about 15% today to 50% over the next decade, Shopify's annual revenue could more than quadruple -- from $2.93 billion in 2020 to $12 billion in 2025.

Shopify primarily serves small to medium-sized businesses, but it now serves an increasing number of large enterprise customers with its Shopify Plus platform. Walmart tethered its third-party online marketplace to Shopify's services last year, and other brick-and-mortar retailers could follow that lead.

But could it become as big as Amazon?

If Amazon grows its revenue at an average rate of 25% annually over the next five years, it could generate $1.18 trillion in annual revenue in fiscal 2025. If its revenue growth decelerates to 20% over the following five years, it could generate $2.93 trillion in annual revenue in fiscal 2030.

That growth could be supported by the expansion of Amazon's e-commerce ecosystem with new overseas platforms, acquisitions of more brick-and-mortar stores like Whole Foods, and purchases of smaller online marketplaces. It will also be driven by the growth of the global cloud infrastructure platform market, which Amazon Web Services (AWS) still leads by a wide margin.

Assuming Amazon's stock still trades at about four to five times its annual revenue, the company could be worth more than $13 trillion by 2030. That forecast might be too optimistic -- since it doesn't factor in recessions, antitrust regulations, or other unforeseen challenges -- but I think a CAGR of 22.5% over the next decade is a realistic target for Amazon.

If Shopify can generate $12 billion in annual revenue by 2025, it would represent a CAGR of 32.6%. If it maintains that growth rate over the following five years, it could generate nearly $50 billion in revenue in 2030. That also sounds like a realistic growth trajectory for Shopify, especially as internet and e-commerce penetration rates rise worldwide.

Shopify currently trades at over 60 times last year's sales and about 40 times this year's sales. Assuming its price-to-sales ratio cools off to about 30 times sales, it could be worth $1.5 trillion by 2030.

Look beyond the market caps

Shopify will likely still be worth less than Amazon in 10 years, but that doesn't mean it will be a weaker investment. Shopify could still generate stronger revenue growth than Amazon for the foreseeable future, and crossing the $1 trillion mark within the next decade would be a remarkable accomplishment for a company that was founded in 2006. It would also become Canada's first trillion-dollar company.

The past decade revealed that Shopify's decentralized approach has just as much staying power as Amazon's centralized marketplaces, and that trend could easily continue over the next 10 years.