In the past couple of decades, arguably the most noticeable change across the economy has been the advent of the internet. And as the world has become increasingly digital, online shopping is now extremely popular.

But e-commerce spending only represents less than 16% of all retail spending in the U.S., so there is a lot of expansion opportunity.

For investors, it's important to think about how to profit from this trend. They can benefit by buying shares in all of the following businesses. This way, the growth of e-commerce will be a nice tailwind to their portfolios.

The elephant in the room

Founded about three decades ago, Amazon (AMZN 3.43%) is the poster child for the rise of online shopping. The self-proclaimed "most customer-centric company" went from selling just books online to now selling almost anything consumers can think about.

It's hard to overstate Amazon's dominance. About 38% of all spending that happens online in the U.S. goes through Amazon. And it's one of the most popular websites in the world, attracting 4.2 billion visitors in October.

The company has some unique advantages that should keep it ahead of the competition. Its massive scale and robust logistics network allow the shipping of packages more economically. The free and fast shipping that Prime members love is only possible with its well-oiled machine.

The company also benefits from powerful network effects: The more buyers and sellers who come to the site, immediately make the platform more valuable. And by facilitating so much commerce, Amazon amasses a trove of data that informs various strategic decisions for the management team. This business truly has a wide economic moat.

Even though the stock has soared 75% in 2023 (as of Nov. 22), it currently sits 21% below its all-time high. Moreover, the price-to-sales multiple of 2.8 is reasonable.

Narrowing the focus

Online shopping is such a massive and powerful trend that there are other companies doing interesting things that investors can consider buying besides Amazon.

Etsy (ETSY 0.34%) has successfully protected itself against Amazon by focusing solely on unique, vintage, and handmade merchandise. The company's growth has slowed dramatically from the huge gains during the pandemic's height. But revenue, gross merchandise sales, and the user base of active buyers and sellers are all significantly higher than a few years ago.

According to executives, Etsy has tapped only 2.5% of its addressable market opportunity. Once the economy improves and consumers are keen on spending more, the business should benefit. Shares have been so hammered that they trade at a compelling forward price-to-earnings ratio of just 15.2. Adding Etsy to your portfolio seems like a no-brainer decision.

Investors should also consider Shopify (SHOP 1.11%), which provides various services -- like payment processing, inventory management, and marketing tools, among numerous others -- that allow merchants to seamlessly start selling online. The company's story is still characterized by rapid growth: Revenue jumped 25%, and gross profit soared 36% in the 2023 third quarter (ended Sept. 30).

Owning Shopify is a true pick-and-shovel play. It's a good idea to invest in an infrastructure provider for e-commerce merchants. As the overall industry expands, this company is in a prime position to benefit as a mission-critical service provider. And with the stock down 58% from its November 2021 peak, it's a smart move to purchase shares on the dip.

By buying the stocks of all of these businesses, investors can ensure they have solid exposure to the growth of online shopping.