In 2022, Amazon.com (AMZN 3.20%) set a record as the world's first public company to lose over $1 trillion in value. 

The stock is up just 14.4% in the last four years and is down 54% from its all-time high, heavily underperforming the Nasdaq Composite and S&P 500

However, Amazon's wide moat, innovation, and industry-leading position in cloud IT infrastructure and e-commerce make it a business that could one day become the most valuable publicly traded U.S.-based company. But to get there, Amazon needs to first boost its profitability and prove to investors that it can be more disciplined with its spending.

In the meantime, the stock could keep falling for several reasons within and outside of its control. Despite that risk, Amazon is simply too good of a company with too attractive of an investment thesis to pass up. Here's why it's my top stock for 2023.

A technician works on a laptop while overseeing a data center.

Image source: Getty Images.

Amazon's approach is a double-edged sword

Amazon is famous for taking whatever cash flow from operations (CFO) it generates and pouring it back into its core business and new ventures. The result of this strategy is that Amazon seldom generates free cash flow (FCF) or net income.

Sometimes, the company wins big -- really big. Like in the case of Amazon Web Services (AWS), which is widely believed to account for the majority of Amazon's value today. Other notable successes include Amazon's acquisition of Twitch in 2014 for just $970 million in cash -- a steal in hindsight.

Amazon doesn't disclose Twitch revenue in its financial reporting. But according to Twitch, the company has more than 31 million average daily visitors.For comparison, Alphabet's (GOOG 1.75%) (GOOGL 1.68%) YouTube has over 122 million active users daily, according to Global Media Insight. YouTube ads generated over $7 billion in revenue in Alphabet's Q3 2022.

It's not an apples-to-apples comparison. But Twitch is similar to YouTube in that it makes most of its money from ads and compensates content creators by paying them for subscribers. Amazon also bundles Prime Gaming on Twitch with Amazon Prime and Prime Video -- expanding its subscription offering and making it more sticky.

In addition to Twitch, other noteworthy investments include Amazon Audible, security and alarm system Ring, and the Internet Movie Database (IMDb).

However, Amazon has also failed in obvious ways. The Amazon Fire Phone was a massive disappointment. Recently, there's been an argument that the company has been pouring too much money into both its streaming segment and its e-commerce business. The figures may shock you.

For the nine months ended Sept. 30, 2022, Amazon North America generated $222.5 billion in net sales but racked up $225.1 billion in operating expenses. The international segment was even worse, notching $83.5 billion in net sales but $89.1 billion in operating expenses. Together, Amazon North America and international posted an operating loss of $8.1 billion for the nine months ended Sept. 30, 2022. Meanwhile, AWS generated $58.7 billion in sales and only $41.1 in operating expenses, leading to operating income of $17.6 billion, which more than makes up for losses in other parts of the business.

So although AWS accounts for less than a fifth of Amazon's revenue, it is the real cash cow of the business that is bankrolling (and, in this case, bailing out) the company's e-commerce segment.

Amazon's business is hard to value right now

Slowing top-line growth and losses from Amazon's e-commerce segment paired with high margins and rapid growth from AWS make the company incredibly hard to value. Due to its lack of consistent profitability, the price-to-sales (P/S) ratio is commonly used to value Amazon. Amazon's P/S ratio is right around a 10-year low and well below its 10-year median.

AMZN PS Ratio Chart

AMZN PS Ratio data by YCharts

As attractive as the low P/S ratio is, it's not a good enough reason to buy Amazon stock right now because P/S overweights the value of the e-commerce business and underweights the value of AWS.

On the flip side, price-to-earnings or price-to-FCF ratios won't work because Amazon's earnings and FCF are so inconsistent.

In my opinion, price-to-CFO (P/CFO) does the best job of balancing Amazon's sales with its profitability. CFO, also known as operating cash flow, is just revenue minus operating expenses. CFO will account for operating losses from Amazon's North America business and its international segment while also showing the operating gains from AWS.

At the end of the day, Amazon needs to prove that it can generate positive CFO so that it isn't relying on equity or debt financing. In other words, some parts of the company can be struggling or losing cash so long as the overall CFO is growing.

Amazon's P/CFO is currently near a 10-year low and well below its 10-year median.

AMZN Price to CFO Per Share (TTM) Chart

AMZN Price to CFO Per Share (TTM) data by YCharts

What this chart and the P/S chart tell us is that Amazon stock is relatively inexpensive based on both its sales and its CFO. But what investors really want to see is consistent FCF and growing earnings because CFO doesn't account for items like capital expenditures, taxes, interest expenses, depreciation, or amortization.

Being FCF positive in a business climate of rising interest rates allows a company to avoid taking on debt, fund acquisitions with cash, and buy back its own stock at a lower price. The issue with Amazon is that it doesn't have the wiggle room to do that because it pours so much money back into its business, which accelerates growth but also amplifies the impact of a recession.

How Amazon can fit into a diversified portfolio

Amazon stock is a relatively risky bet compared to its megacap peers like Apple, Microsoft, or Alphabet because it doesn't generate consistent FCF or earnings. But the company has repeatedly stated its long-term goals are to manage its share dilution and optimize its FCF. Over time, Amazon should become consistently FCF positive and profitable. It's just right now, the market is showing very little patience toward what a company could become and is focusing instead on what it is today.

Long-term investors are getting a chance to buy Amazon at a historically low P/S ratio and P/CFO ratio. The stock is practically the same price today as it was four years ago. Yet in the first three quarters of 2022 alone, AWS generated over 2.4 times more operating income than in all of 2018. And the company has made meaningful strides in Amazon Prime Video, advertising, and the e-commerce business, even though those improvements aren't bearing fruit in the short term.

Amazon is a massive business that can give an investor's portfolio exposure to so many different industries without the risk associated with investing in a smaller pure-play company. As bad as the short-term outlook is for Amazon, it's still in a great position to take market share during a recession. For that reason, it's the kind of growth stock that can appeal to a wide variety of investors and can even grow to become a foundational holding in a portfolio.