Apple (NASDAQ:AAPL) versus Google.

These tech titans have battled against each other for over a decade, all the while rewarding their shareholders with the spoils of war.

But which is the better buy today? Let's find out.

Chess pieces facing off against each other.

Image source: Getty Images.

Moat 

Google -- which reorganized itself as a subsidiary of Alphabet (NASDAQ:GOOG) (NASDAQ:GOOGL) in 2015 -- dominates the worldwide internet search market. Its share of U.S. search ad revenue will grow to 80% in 2018, according to eMarketer, up from nearly 76% in 2016. On a global basis, Google's commands an even higher share, with StatCounter placing it at more than 90%.

Apple's iPhone consistently receives high marks in build quality, performance, and aesthetics. The same is true of Macs and, to a somewhat lesser extent, the iPad. But while Google is the unquestioned leader in search, Apple often holds a minority share of the markets in which it competes. In fact, despite the popularity of the iPhone, Apple is estimated to have only about a 15% share of the global smartphone operating system market, according to market intelligence company IDC, compared to 85% for Google's Android.

It's true that Apple's products are typically far more profitable than Android devices, and Apple therefore holds a much larger portion of the industry's profits. Yet it also remains true that Apple faces significantly more formidable competition in its core markets than Google does in search. So, in terms of the strength of their competitive moats in their core businesses, Google has the edge over Apple.

Advantage: Alphabet

Profitability and cash generation

Both Apple and Alphabet are incredibly profitable businesses. Over the past 12 months, Apple and generated more than $46 billion in net income, while Alphabet earned over $19 billion.

Their cash production is similarly impressive. Apple delivered a staggering $51 billion in free cash flow over the past year, compared to $25 billion for Alphabet.

Yet while both companies excel in these areas, Apple's profitability and cash generation are simply unparalleled.

Advantage: Apple

Growth

Over the past half-decade, Google (now Alphabet) has generated about 30% more growth in earnings per share than Apple.

AAPL EPS Diluted (TTM) Chart

AAPL EPS Diluted (TTM) data by YCharts.

This trend is likely to continue, with analysts forecasting that Alphabet will grow its EPS at more than 19% annually over the next five years, compared to slightly more than 12% for Apple. So, in terms of growth -- both recent past and future -- Alphabet is the clear leader.

Advantage: Alphabet

Valuation

No better buy discussion should take place without a look at valuation. Let's check out some key value metrics for Apple and Alphabet, including price-to-earnings and price-to-free-cash-flow ratios. 

Metric 

Apple

Alphabet (Class A Shares)

Trailing P/E ratio

17.37 

34.92 

Forward P/E ratio

13.89

24.08

P/FCF

15.35 

26.22 

Data source: Yahoo! Finance and Morningstar.

On all three metrics, Apple's shares are considerably less expensive than Alphabet's. Even if we factor in Alphabet's higher expected growth rates, Apple's stock is still more attractively priced based on its price-to-earnings-to-growth, or PEG, ratio of 1.42, compared to 1.65 for Alphabet. So, valuation-wise, Apple is the better bargain.

Advantage: Apple

Additional factors

With this better buy battle all tied up after four rounds, let's look at some additional aspects of these tech titans' businesses to help you decide what's best for your portfolio.

Income-seeking investors will likely appreciate Apple's 1.7% dividend yield. Apple has increased its quarterly cash dividend payment by more than 10% annually over the last three years, and with an earnings payout ratio of less than 30%,  shareholders should expect that trend to continue.

On the other hand, growth investors may appreciate Alphabet's "moonshots." The company is investing aggressively in high-risk yet potentially ultrahigh-reward projects like those being tackled by its Verily Life Sciences unit. Verily is trying to "radically transform" healthcare, with Sci-Fi like projects such as glucose-monitoring contact lenses for diabetics, bioelectronics medicine, and advanced surgical robots, just to name a few. Although many of these programs may fail, the ones that do succeed can boost shareholder returns -- and potentially even benefit the human race as a whole.

Advantage: You decide 

Ultimately, you'll have to decide which of these factors is more important to you. If you're a value-focused dividend lover, then Apple is the way to go. If a wide competitive moat and exciting growth opportunities are more your speed, then Alphabet is the better choice. Either way, you'll be buying an outstanding business.

Suzanne Frey, an executive at Alphabet, is a member of The Motley Fool's board of directors. Joe Tenebruso has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Alphabet (A and C shares) and Apple. The Motley Fool has a disclosure policy.