Few stocks today attract the level of attention that Amazon (NASDAQ:AMZN) and Google-parent Alphabet (NASDAQ:GOOG) (NASDAQ:GOOGL) do.

That's understandable: They're nearly unavoidable. Amazon, as the nation's dominant online retailer, controls more retail spending in the U.S. than any other company aside from Walmart, and its massive cloud computing business, Amazon Web Services, helps the websites and businesses Americans use every day run successfully. And the Google search engine is so popular that it became a verb. That competitive advantage alone would be enough to hold investors' interest, even without considering Alphabet's many other popular websites and services, such as YouTube, Gmail, and the Chrome web browser.

Both companies also weigh in with market values close to $1 trillion, and they make up half of the famed quartet of FANG stocks that have provided a large fraction of the bull market's gains over the last decade.

As the chart below shows, when it comes to stock price appreciation, Amazon has been the clear winner over the past five years, though after a year of ups and downs, both stocks are trading close to where they were last September.

Let's take a closer look at where these two tech giants stand today to see which stock looks like the better buy.

The boundless disruptor

Amazon has been the best-performing stock on Wall Street for the last generation for one reason above all others. The company has consistently bucked investor expectations, building competitive advantages, expanding its core e-commerce business, and breaking into new businesses. It has demonstrated the potential of optionality more than any other company.

As recently as 2014, it lost money on the bottom line, but today, Amazon is undoubtedly thriving and highly profitable. Net income reached $10 billion last year, and is on track to be even higher in 2019.

Amazon still trades at a lofty valuation at a P/E ratio of 72, but that ratio is so high because the company has earned the benefit of the doubt from investors, who recognize and appreciate that it's spending aggressively to strengthen its competitive advantages -- spending which cuts into its profits.

An illustration of this came earlier this year when Amazon said it would speed up the free product delivery shipment time for Prime members from two days to one day. Though making that happen will take a bite out of net profits, investors cheered the initiative based on the principle that it will help the company defend and expand its lead in e-commerce.

The tech giant has also demonstrated a knack not just for being a disruptor, but for recognizing emerging, high-growth industries, and diving into them to rapidly gain market share. It's done this time and again, with e-commerce, e-books and tablets, video streaming, voice-activated technology, and cloud computing, among other areas. Each time, it employs a similar playbook, putting the customer first, and investing for the long term.

Guided by founder and CEO Jeff Bezos, arguably the most admired leader in business today, the company is now pushing into healthcare with its recent launch of Amazon Care, a pilot service for its employees that may eventually be expanded to the general public. As with Amazon Care and other experiments, what makes this company special is that its business isn't limited by any conventional industry definition. It fearlessly pursues any opportunity where it sees a chance to make things better for customers.

An advertising gold mine

No other company has profited more off the internet than Google. Founded in 1998, it was actually late to the dot-com party, but its search engine nonetheless came to dominate, allowing it to make a mint off advertising. Alphabet brought in $116 billion in ad revenues last year -- amounting to 85% of its total revenue of $137 billion -- and that business has been the primary generator of its profits, which reached more than $30 billion last year.

That successful advertising business has given the company the ability to spend freely on unrelated projects it categorizes as "other bets" or moonshots. These include Waymo, its autonomous vehicle unit; Google Fiber, the cable-and-internet service; and GV, its venture capital arm.

In 2018, the "other bets" segment brought in $595 million in revenue, but generated an operating loss of $3.4 billion. The expectation, of course, is that at least some of those businesses will pay off in the long run. Waymo, for example, is considered to have a valuation above $100 billion, as it's generally viewed as one of the leaders in autonomous vehicle technology.

Alphabet trades at a more reasonable valuation than Amazon, with a P/E of 25 -- near the market average. It also has $121 billion in cash and marketable securities on its balance sheet, a situation which has led some investors to ask when the company will start to pay a dividend.

Its core business continues to grow by near 20% annually, and the company has found some success in its Google Other business, which includes apps, hardware, and Google Cloud services. The big question seems to be if it can become more than just an advertising behemoth.

Which is the better buy?

Both of these tech giants are fast-growing and have developed massive competitive advantages. The major differences between them come down to valuation and optionality.

Amazon clearly has the more expensive stock, and it lacks the cash hoard of Alphabet. But it has done a better job of breaking into new industries than the search giant -- Amazon Web Services, for example -- so it seems reasonable to think it's more likely to achieve similar successes in the future.

Yet choosing which of these two stocks is "better" may come down to your investing style. Alphabet is more likely to appeal to value investors, since its stock is much cheaper, and the company is anchored by its massive cash balance. Amazon, on the other hand, appears to have more potential for growth.

Of the two, I would choose Amazon, but both have the ingredients to outperform the market over the long term.