Online shopping may have tapered off in 2021 from the historic surge it witnessed during the lockdown phase of the pandemic. But the Commerce Department says e-commerce still rose over 14% last year, with shoppers spending $870.8 billion online.

That was in line with total retail sales, which also rose 14% to $4.5 trillion, and e-commerce accounted for nearly one in five dollars spent by consumers. It also means that shoppers didn't completely abandon the habits they developed during the early phases of the pandemic.

Even though e-commerce soared by more than 31% in 2020, consumers are still turning to online markets for their shopping needs today and will continue to spend increasing amounts of money online in the future. That makes investing in e-commerce stocks a sure-fire winner, and the following three companies are among the best options out there.

A person excited by the contents of an opened box.

Image source: Getty Images.

1. Amazon.com

Of course, Amazon.com (AMZN -4.17%) has to be in the mix because of its dominance in U.S. and European markets and its leading position in Asia, exclusive of China, where Alibaba (BABA -0.54%) dominates the market. 

While Amazon's revenue growth slowed in 2021 to just 21% in currency-adjusted dollars compared to 38% the year before, it continues to account for a massive portion of all e-commerce sales. DigitalCommerce360 estimates that between Amazon's own sales and those of third-party merchants, gross merchandise value (GMV) rose 18.8% to $379 billion to give Amazon a 43.5% share of the U.S. market.

Moreover, of the entire increase in total e-commerce sales last year, Amazon was responsible for 55.4% of it. It's clear that for many consumers, Amazon.com is the first place they turn to when they need something and very often the only place they look.

Coupled with the powerhouse that is Amazon Web Services, the highly profitable cloud infrastructure service that powers the internet presence and online capabilities of so many other companies and institutions, Amazon is the one-stop-shop for everything e-commerce. Its stock has fallen almost 20% from recent highs, which seems an overreaction to the natural slowdown, partially caused by supply chain issues beyond its control.

That's putting Amazon's stock back in the area where it was before the pandemic. For a company that owns nearly half the online market and is responsible for well more than half of e-commerce's growth, that makes it a bargain stock, one you can own for decades.

Person with credit card smiling at multi-colored shopping bags

Image source: Getty Images.

2. JD.com

Chinese e-commerce platform JD.com (JD -0.28%) is the eBay of China, an online platform for third-party sellers, and consumers are flocking to its virtual aisles

Third-quarter sales soared 25.5% to $33.9 billion, almost as good as the 29% gain it saw in the same period the year before. Annual active customer accounts -- people who have made at least one purchase over the past year -- jumped by a similar percentage to reach 552.2 million. 

During China's annual Singles Day sales extravaganza, the equivalent of Amazon's Prime Day event but stretched out over 11 days, JD.com generated $54.6 billion in GMV. In comparison, Prime Day generated sales of $11.2 billion for Amazon.

As China has cracked down on tech stocks, especially companies affiliated with Alibaba's Jack Ma, the markets have worried about the fallout for JD.com, sending its stock lower. And just this month, Beijing ordered Chinese companies to report their exposure to Alibaba's Ant Group, the financial firm Ma had planned on taking public until intense regulatory scrutiny scrubbed it. 

Previously JD has said it had little to worry about in such a crackdown, but investing in Chinese stocks has become riskier as a result. Still, the e-commerce giant has navigated the waters successfully thus far and should be able to grow for years to come.

Person counting money at cash register.

Image source: Getty Images.

3. Shopify

Not an e-commerce site itself, Shopify (SHOP -2.78%) is the seller of picks and shovels to those wanting to establish an e-commerce presence. That business exploded during the pandemic as people out of work sought to start up their own businesses, but that has since eased as the economy reopened.

In Shopify's fourth-quarter earnings report last month, CFO Amy Shapero told analysts, "We believe that the Covid-triggered acceleration of e-commerce that spilled into the first half of 2021 in the form of lockdowns and government stimulus will be absent from 2022."

The slowdown caused Shopify's stock to crater, dropping shares to lows not seen since the pandemic first began. That seems highly short-sighted because of the potential its business still represents.

Shopify is becoming a vertically integrated one-stop-shop for businesses small and large. While its original focus was on helping mom-and-pop shops start, medium-size and enterprise-class businesses are now turning to Shopify's offerings, which it continues to expand.

Beyond just the typical back-end operations it specializes in, Shopify is now offering businesses a slew of new options, including merchant money management accounts (Shopify Balance), small business loans (Shopify Capital), fully hosted enterprise e-commerce platforms (Shopify Plus). It will begin selling NFTs, or non-fungible tokens, to help businesses and brands connect with their customers and fans.

With e-commerce solidly cemented with consumers, Shopify is a sure bet for decades-long growth.