Alphabet (GOOG -3.89%) (GOOGL -3.93%) and Apple (AAPL 0.53%) are two of the largest and most valuable enterprises in the world. In both cases, they have achieved incredible brand name recognition and built nearly unassailable moats around their businesses. Not surprisingly, both have also been a great investment over the last five years, though Apple stock has surged in value by 470%, outpacing Alphabet's 260% gain.

But which of these tech giants is the better buy today? Let's dive in and see if we can answer the question.

Investor holding newspaper and looking contemplative.

Image source: Getty Images.

Alphabet: A powerhouse in digital ads and cloud computing

According to Forbes, Alphabet's Google is the second-most valuable brand in the world. But that's not surprising. After all, Google is essentially the gateway to the internet.

Google Search is the world's most popular search engine, Google Chrome is the world's most popular browser, and YouTube is the third-most profitable streaming service, behind offerings from Disney and Netflix. Those advantages have helped the company collect troves of consumer data, propelling Google to the forefront of the digital ad industry.

Last year, despite a 4% contraction in global ad spend, Google services revenue jumped 11% to $169 billion. Put another way, the company captured nearly 28 cents out of every $1 spent on digital advertising. But that's only half of Alphabet's story.

The company's cloud computing business is also growing quickly. Last year, the pandemic made digital transformation an imperative for many enterprises, and Google Cloud revenue surged 46%. Notably, that's significantly faster than the industry average of 33%, which indicates that Google is gaining market share.

Not surprisingly, Alphabet has posted impressive results over the long term, growing at a good clip on both the top and bottom lines.

Metric

2017

Q1 2021 (TTM)

CAGR

Revenue

$110.9 billion

$196.7 billion

19%

Free cash flow

$23.9 billion

$50.7 billion

26%

Source: Alphabet SEC Filings. TTM: trailing 12 months. CAGR: compound annual growth rate.

As a final thought, Alphabet has also invested heavily in moonshots like DeepMind and Waymo, both of which are using artificial intelligence to solve complex problems related to healthcare and mobility. While neither company is currently profitable, if either achieves success in the future, it could transform Alphabet's business.

But even if that doesn't happen, Alphabet should still benefit from the continued rise of digital advertising and cloud computing. And the company's significant scale and cash-heavy balance sheet should help it fend off rivals in the years ahead.

Apple: Offering products people will pay a premium to get

According to Forbes, Apple is the most valuable brand in the world -- and it's easy to see why. Consumers are consistently enamored with Apple hardware, and they are willing to pay a premium for it. That pricing power is a significant advantage.

Man using recently released orange iMac.

Image source: Apple.

Last year, Apple's launch of the iPhone 12 was met with strong demand, helping the company capture 16% of the smartphone market, second only to Samsung's 20% market share. To add, Apple also introduced the M1 chip last year, a custom-built processor designed to boost Mac battery life and performance. This new silicon chip has already been a big winner, driving record Mac sales in the most recent quarter.

Beyond hardware, Apple is also investing aggressively in services. Since 2018, the company has launched subscription products like Apple Fitness+, Apple TV+, and Apple Arcade. These complement other services like Apple Music, Apple Pay, and the App Store, all of which further the company's ability to monetize its global user base.

Overall, Apple's financial performance has been relatively strong in recent years, though weak iPhone sales in 2019 and 2020 were headwinds to growth.

Metric

2017

Q2 2021 (TTM)

CAGR

Revenue

$229.2 billion

$325.4 billion

11%

Free cash flow

$51.8 billion

$90.5 billion

17%

Source: Apple SEC Filings. TTM: trailing 12 months. CAGR: compound annual growth rate.

Looking ahead, Apple's services business represents a significant growth opportunity. In fact, Evercore ISI analyst Amit Daryanani believes services revenue will hit $100 billion by 2024, representing roughly 17% growth per year.

To add, Apple may have more revolutionary hardware in the works. Earlier this year, it partnered with Taiwan Semiconductor Manufacturing to build micro-OLED displays -- the type of displays that could be used in augmented reality (AR) glasses.

The verdict

Alphabet and Apple are both impressive businesses. And in terms of valuation, they have a similar price tag, with Alphabet trading at nine times sales and Apple trading at seven times sales. Moreover, both have strong growth prospects in the years ahead, and I think either could be a market-beating investment.

That being said, Alphabet wins this contest. With a $1.7 trillion market cap, it's a smaller company than Apple, which currently has a market cap of $2.3 trillion. Not only that, but Alphabet is also growing more quickly. I think that leaves more upside for investors.