Last year, as the pandemic forced business closures and social distancing, consumers turned to digital channels for shopping and entertainment. While that hurt many traditional retailers and media companies, it was a strong tailwind for Amazon (AMZN -2.88%) and Roku (ROKU -0.49%).

Over the last three years, both of these tech stocks have outperformed the broader market, with shares of Amazon rising 120% and Roku surging 1,000%. But which one is the better buy today?

Amazon

Amazon was a first mover in the e-commerce industry, and that advantage has led the company to incredible success. Today Amazon is the largest online marketplace in the U.S., supported by an extensive fulfillment and logistics network. Last year that scale helped Amazon capture an incredible 40% of online retail spending in the United States.

Amazon Prime semi-truck.

Image source: Getty Images.

Amazon continues to press its advantage here. In 2020 the company expanded its fulfillment footprint by 50%, and now handles over 50% of its own shipping. That gives Amazon greater control over transit times, which ultimately creates a better experience for customers.

Last year, growth in online sales and third-party seller fees accelerated to 46% and 57%, respectively. Additionally, higher order volume in international markets helped Amazon achieve operating profitability outside of North America.

Like its online marketplace, Amazon's cloud computing business -- Amazon Web Services (AWS) -- was also a first mover. Today AWS is still the industry leader, with a more comprehensive portfolio of services than any of its rivals. That value proposition helped it win new customers like JP Morgan Chase and Twitter last year, and powered revenue growth of 30%.

Looking ahead, Amazon still has opportunities to expand, despite its $1.7 trillion market cap. For example, the company's digital ad revenue hit $15.7 billion in 2020, according to eMarketer. That means Amazon captured 10.3% of all digital ad spending in the U.S., up from 7.8% in 2019.

As a whole, Amazon's businesses have powered strong growth on both the top and bottom lines.

Metric

2017

2020

CAGR

Revenue

$177.9

$386.1 billion

29%

Free Cash Flow

$6.4 billion

$25.9 billion

59%

Data source: Amazon SEC filings. CAGR = compound annual growth rate.

In the years ahead, Amazon should continue to benefit as e-commerce, cloud computing, and digital advertising continue to gain popularity -- even without Jeff Bezos.

Roku

Roku is the leading streaming platform in the United States in terms of streaming hours, active accounts, and smart TV sales. Its platform offers viewers a convenient way to access and manage all of their streaming services, including subscription-based and ad-supported content.

Roku is increasingly differentiating itself through content. Specifically, The Roku Channel is a collection of ad-supported programming available to Roku users. The company obtains content by licensing, purchasing, and negotiating deals with publishers, and currently offers access to more than 40,000 movies and shows, and 165 live TV channels.

Earlier this year Roku announced its acquisition of original programming from Quibi. The company rebranded this content as "Roku Originals", and plans to make it available to viewers on The Roku Channel later in 2021. The company also announced that "Roku Originals" would be the brand name for future original content, implying this could be an important part of its growth strategy in the future.

Last year Roku reached 51.2 million active accounts, up 39% over the prior year. That's important for two reasons: First, as more consumers join Roku, it collects more data, making its AI-powered recommendation engine more intelligent. Second, as Roku adds viewers, its platform becomes more valuable to marketers, which ultimately means Roku captures more ad dollars.

Also noteworthy, streaming hours reached 58.7 billion in 2020, up 55% over the prior year. This indicates improving user engagement, which further sweetens the deal for marketers. Not surprisingly, monetized ad impressions jumped over 100% in Q4 2020, and total ad spending on Roku's platform more than quadrupled last year.

Roku's ability to add new accounts and drive user engagement has powered strong top-line growth in recent years.

Metric

2017

2020

CAGR

Revenue

$512.8 million

$1.8 billion

51%

Free Cash Flow

$28.1 million

$65.8 million

33%

Data source: Roku SEC filings. CAGR = compound annual growth rate.

Roku's growing clout in the streaming industry has given it some bargaining power. Going forward, this should help the company bring new content to its platform, driving user growth in the process. Furthermore, Roku partners with over a dozen manufacturers to produce its Roku TVs, which should also help bring new users to the platform. Together, these growth drivers give Roku a shot at gaining ground in the massive U.S. digital ad market, which will exceed $190 billion in 2021, according to eMarketer.

The bottom line

For what it's worth, I am a shareholder of both Amazon and Roku, and I have no plans to sell either stock. Amazon is certainly much more profitable and has achieved must greater scale compared to Roku. Even so, it's hard for me to imagine Amazon as a five-bagger over the next decade.

By comparison, Roku has a market cap of $46 billion, but I can picture this tech company as a $250-$300 billion business in the future. Additionally, Roku has established itself as a leader in the booming streaming industry -- and I think that leaves more upside for long-term investors.

So, by a thin margin, Roku wins this contest.