Some companies are so strong and have such incredibly long runways of growth ahead that you may never need to sell the shares. The advantage with this approach is that the stock can compound in value without you having to pay capital gains taxes.

Here's why Amazon (AMZN 2.19%) and Shopify (SHOP 1.41%) are two quality stocks you can buy today and hold for potentially years of compounding returns.

1. Amazon

Online shopping might seem commonplace today, but it only comprised 15% of total retail sales in the U.S. in the first quarter of 2024. That relatively small figure highlights the enormous runway of growth for the leader Amazon that continues to absorb a growing share of the e-commerce market.

Amazon is a large business with multiple revenue streams. While non-retail services like cloud computing and advertising have been two of its faster-growing businesses in recent years, revenue from online stores still makes up more than a third of its total revenue, and it's still gaining market share. J.P. Morgan expects Amazon's share of U.S. e-commerce to reach 44.5% this year, surpassing the current leader, Walmart.

The reason this is significant is that Amazon's online retail business is becoming more efficient at converting revenue into more profit, which is why the stock is up 48% over the last year. In the first quarter, the company's operating income jumped 221% year over year due to higher margins from online sales. Lowering retail costs is an ongoing process, so investors should expect more robust profit growth over the next year.

As management shortens the time that inventory sits in fulfillment centers and speeds up delivery times, it will lead to more frequent shopping behavior, which could boost sales and earnings. The average analyst on Wall Street expects Amazon's earnings per share to grow 23% on an annualized basis in the coming years. Assuming the stock continues to trade at the same valuation, it could climb at roughly the same rate over the next few years.

2. Shopify

The global e-commerce market is valued at $4.1 trillion, according to Statista, but Amazon is not going to capture 100% of that market. That means there are potentially millions of businesses around the world that could turn to Shopify to help grow their online retail presence.

Shopify generates roughly a quarter of its revenue from subscriptions, but most of its revenue comes from service fees in merchant services, including payment processing. This means Shopify can grow through adding more merchants but also helping those merchants grow sales.

Shopify is basically a business partner with its merchant customers. It continues to bring more tools to the platform, which is widening the company's competitive advantage.

Over the past two years, Shopify has launched more than 400 new features. It's no surprise to see the company's merchant services revenue grow 20% year over year to $1.4 billion in the first quarter. It's continuing to see growing adoption of Shopify Payments, which is the primary driver of merchant services revenue.

Shopify's growth is translating to growing free cash flow that management can reinvest into more innovation for its merchant customers. Since exiting its logistics business, the company has seen trailing-12-month free cash flow increase sharply over the last year to surpass $1 billion. Shopify's innovation and growing free cash flow is setting up another bull run for the stock.