Amazon (NASDAQ:AMZN) and Microsoft (NASDAQ:MSFT) are ranked second and third, respectively, on Fortune's list of Most Admired Companies. That's not surprising. These tech titans have both achieved incredible success, and both have been rewarding investments in the past.

In the last year, shares of Amazon have jumped 65% and Microsoft stock is up 55%. But which is the better buy today?

Amazon: The retail giant

Amazon has an impressive list of accomplishments: It's the largest e-commerce marketplace in the United States and the second-largest retailer in the world, with over 1.7 million small and medium-sized businesses on its platform. Additionally, Amazon Web Services is the leading provider of public cloud services worldwide, with a 32% market share in the fourth quarter of 2020.

Amazon delivery driver holding a package with an open delivery van behind him

Image source: Amazon.

Beyond its core markets, Amazon is also gaining traction in digital advertising. The company's content platforms -- Amazon marketplace, Fire TV, and Twitch -- are valuable real estate in the advertising world and marketers are willing to pay for it. Amazon also provides ad tech platforms to both buyers and sellers, allowing it to profit from ad sales occurring on and off company-owned websites and apps.

In 2020, Amazon's digital ad revenue reached $15.7 billion, according to eMarketer. That represents 10.3% of the U.S. digital ad market, putting the company in third place behind Alphabet's Google and Facebook. Notably, Amazon has gained significant ground since 2018, when its ad business generated $9.9 billion, taking a 6.8% market share.

These three growing markets -- online shopping, cloud computing, and digital advertising -- have powered Amazon's strong financial performance in recent years.

Metric

2017

2020

CAGR

Revenue

$177.9 billion

$386.1 billion

29%

Free cash flow

$6.4 billion

$25.9 billion

59%

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

Despite its massive size, Amazon remains well positioned for growth in its core markets. The company recently signed an exclusive 10-year deal with the NFL to bring Thursday Night Football to Amazon Prime Video. This partnership should drive growth in Prime memberships and help Amazon expand its digital ad business.

Microsoft: The software giant

Microsoft has an equally impressive background. The Microsoft 365 suite includes industry-leading applications like Word, PowerPoint, and Excel, which have helped the company capture nearly 90% of the market for office productivity software.

Four Microsoft surface computers.

Image source: Microsoft.

Additionally, Windows is the leading desktop operating system worldwide by a wide margin, allowing Microsoft to earn licensing revenue from third-party PC manufacturers.

In cloud computing, Microsoft Azure currently ranks second behind AWS, but it's growing more quickly. Revenue jumped 56% in fiscal 2020 (ended June 30, 2020), helping Azure capture a 20% market share, up from 18% at the end of 2019.

Notably, Microsoft is driving this growth through continued investments in data center infrastructure, as well as by expanding its service offerings, particularly in the areas of artificial intelligence, data analytics, and developer tools.

Finally, gaming has become a sizable part of this tech titan's business. In fact, gaming revenue reached $9.6 billion in fiscal 2020, representing just under 7% of Microsoft's total sales. And through the first half of 2021, gaming revenue is up 38%, driven by strong Game Pass subscription sales and the highly successful launch of the Xbox Series X and S.

As a whole, Microsoft's financial performance has been impressive in recent years, especially for an enterprise of its size.

Metric

2017

Q2 2021 (TTM)

CAGR

Revenue

$96.6 billion

$153.3 billion

14%

Free cash flow

$31.4 billion

$50.4 billion

15%

Data source: Microsoft SEC filings. TTM = trailing 12 months. CAGR = compound annual growth rate.

As a final thought, unlike Amazon, Microsoft pays a dividend. Currently, the dividend yield sits at 0.84% -- not much compared to some stocks, but with Microsoft's deep pockets, this dividend is as close to a sure thing as you're likely to find.

Going forward, Microsoft is primed for growth. Digital transformation efforts should be a tailwind for its productivity software and cloud computing businesses. And as video games and esports become more popular with consumers, Microsoft may be able to build its gaming business into a third massive revenue stream.

The verdict

Personally, I don't think you can go wrong with either of these companies. Both have achieved nearly unmatched success, and both benefit from strong competitive positions, healthy balance sheets, and big market opportunities.

That being said, Amazon wins this contest. The company is growing more quickly, and its dominant position in cloud computing gives it an advantage. Moreover, Amazon's digital ad business is rapidly taking market share, making it a major player in yet another massive industry. I think that leaves more long-term upside for investors.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.