Shopify (SHOP 1.11%) stock is expensive right now. Shares of the barely profitable e-commerce outfit trade at 74 times next year's expected earnings. The company's pace of sales growth is slowing down, too, even if only because its past growth has made for tougher comparisons now.

However, this is one of these cases where investors' focus shouldn't be on the here and now of the stock's valuation, but on where Shopify's business will be five years from now. The growth in the cards between now and then should take care of any valuation problems that are giving would-be investors pause.

Shopify by the numbers

Shopify is an e-commerce name. It's a crowded arena to be sure, led by Amazon, but with players like Walmart coming on strong in the third-party seller sliver of the market. And don't forget about eBay.

Shopify is different than all of them, however. It doesn't operate a virtual mall showcasing all sellers' goods, in turn forcing them to compete head-to-head with one another. Rather, Shopify offers businesses the tools they need to launch and manage their own online stores. Although the company no longer reports how many merchants use the Shopify platform, it's well into the millions.

In the meantime, the company will say its hosted online stores facilitate roughly 10% of the United States' e-commerce business. And, on a worldwide basis, its tech is handling around $200 billion worth of transactions every year, generating on the order of $6 billion in annual revenue for Shopify itself. That's solid for a relatively young company trying to convince merchants they'd be better off doing their own thing instead of (or in addition to) plugging into Amazon's massive sales platform.

What's not so impressive is the lack of profits Shopify produces even after 17 years in business.

Shopify stock isn't cheap, but...

Shopify is profitable, for the record. The company swung to a profit in the wake of the COVID-19 pandemic, in fact, thanks to the swell of online shopping it spurred. While that wave of profitability didn't last, the swing back into the black this year looks like it could persist. That's because Shopify is working with even more scale and has been able to cull some of the costs caused by the rapid response to the pandemic.

SHOP Revenue (Quarterly) Chart

SHOP Revenue (Quarterly) data by YCharts

But profit margins remain relatively thin. Only $122 million of last quarter's revenue of $1.7 billion was turned into actual operating income, about 7% of its top line; free cash flow of $276 million isn't a whole lot more encouraging.

In a similar vein, the per-share earnings of $0.69 analysts expect for the full year isn't thrilling, translating into a price-to-earnings ratio of over 100. The forward-looking P/E ratio of 74 based on next year's estimated bottom line of $1.04 per share isn't leaps and bounds cheaper. Both are well above market norms of around 20.

What's largely being overlooked here, however, is how Shopify's ongoing growth is going to be of much greater benefit to its bottom line than it will to its top line.

Shopify is reaching critical mass

The greater a company's revenue, the more able it is to cover fixed costs like rent, administrative expenses, and even advertising. Greater scale also gives a company leverage when negotiating prices with its vendors and suppliers.

It wasn't clear in its infancy what Shopify's magic profit number was. Rapidly changing costs made it even tougher to pin down.

With the dust of the COVID-19 pandemic finally settling and the world easing back toward pre-pandemic norms, investors are getting a better feel for how much this company has to spend just to exist. It's around $1 billion per quarter, if not less. Another half of its revenue is burned up by its highly variable costs of revenue, although this proportion could sink as well the bigger Shopify gets. All told, Shopify is profitable when it's generating around $1.5 billion worth of revenue per quarter. Every dollar above that mark adds at least half of any excess to the company's bottom line.

And that's not mere conjecture. The analyst community is essentially saying the same thing. While analysts expect Shopify's revenue to double between now and 2027, they also believe per-share profits will nearly quadruple during this time frame.

Shopify's revenue and earnings growth are expected to accelerate through 2027.

Data source: StockAnalysis.com. Chart by author. Note that this year's swing to a steep loss reflects an impairment charge on the sale of Shopify's logistics business. Without this charge, the company would be profitable in 2023.

This longer-term outlook certainly makes for a much more bullish argument than the stock's current valuation supports. It also overrides analysts' current consensus price target of $68.97, which is 7% below Shopify shares' present price.

Looking five years down the road

Obviously, there are no guarantees when it comes to investing. But long-term returns on stocks tend to be better than nearly any other kind of asset. That's because you're being rewarded for the above-average risks you're taking.

To the extent a long-term price prediction can be made for a stock, though, don't be surprised to see Shopify shares trading in the ballpark of $100 or more five years from now. That will still be a fairly frothy price relative to their likely earnings at that time. But, this premium should be justified by the fact that Shopify's revenue will still be growing at a double-digit pace at that time.

It may well even be re-accelerating at that point.

See, Amazon will be even more of an e-commerce monster by then, aggressively searching for ways to continue its historical growth streak. If its plans to do so mean putting more fiscal pressure on its third-party sellers or pitting them against one another -- as has been the case of late -- millions more merchants and sellers may start looking for self-managed e-commerce solutions. The internet will be another five years older then too, as will its online shoppers. They may well be ready for an online shopping experience beyond a virtual mall by that time.

The fact that Amazon now lets Shopify store owners accept payments from Amazon's payment platform suggests even Amazon itself sees such a shift on the horizon.