Alphabet (GOOGL -1.23%) (GOOG -1.10%) just turned in its second-quarter 2022 earnings report yesterday, and it was rock-solid considering the circumstances. Amid fast-rising fears the global economy is headed for (or maybe, depending on who you ask, already in) a recession, it wasn't surprising that operating profit was flat compared to a year ago. However, thanks to Google Search and Google Cloud, revenue increased 13% from the same quarter in 2021 to $69.7 billion.  

The fact that Alphabet can continue expanding in spite of economic headwinds is impressive, and the internet giant is profitable enough it can plow large amounts of cash into its top growth initiatives to foster more growth once the dark clouds eventually clear. If you're looking for a top stock to buy amid this year's bear market, Alphabet just proved again why it's a worthy candidate.

Google Cloud keeps gaining ground

Within Alphabet's total revenue growth rate of 13% in Q2, Google Search and Google Cloud led the way higher. Search revenue increased 13.5% year over year and accounted for just over 58% of total sales. YouTube ads (up 5%) and Google Other (the Google Play app store, device sales like Pixel and Nest, down 1%) were both a drag.  

Google Cloud was the real standout, though, notching a nearly 36% pace of growth and pulling in $6.28 billion in quarterly revenue. That equates to 9% of total revenue, compared to just 7.5% of the grand total in the same period last year.  

This is significant for a couple of reasons. First, increasing sales coming from Cloud keeps Alphabet's overall operation on the rise, especially as the cloud computing industry is expected to remain a secular growth trend for the remainder of this decade. Paired with steady results from internet search and ads, Alphabet's run of double-digit expansion looks poised to continue for the foreseeable future. If recession does strike (or gets worse), any negative impact is likely to be brief -- just as it was during the Great Recession of 2008-2009 and early in the pandemic in 2020.

GOOGL Revenue (TTM) Chart

Data by YCharts.

And second, Google Cloud remains an unprofitable segment, which is temporarily pulling down overall earnings since it now accounts for a larger share of the business. Alphabet's total operating income margin was negative 14% in the second quarter, compared to negative 13% last year. Cloud margins remaining in the red conspired with other factors like negative foreign currency exchange rates, which lowers the value of a sale made outside of the U.S.  

Alphabet Consolidated Operations

Q2 2022

Q2 2021

YOY Change

Total operating income

$19.5 billion

$19.4 billion

Not meaningful

Operating income margin (as a % of total revenue)

28%

31.3%

(3.3 p.p.)

Data source: Alphabet. YOY = year-over-year. p.p. = percentage points.  

A cash-generating and cash-returning monster

After the Q2 update, Alphabet stock now trades for just over 21 times trailing-12-month free cash flow. With Alphabet's management saying it's spending heavily on things like new data center upgrades and foreign currency exchange rate effects not likely to abate anytime soon, this valuation could get worse before it gets better. Is the stock still a buy?

Consider a few items:

  • Even in less than ideal economic times, Alphabet is a highly profitable business.
  • While other companies may have to cut spending on tech initiatives, Alphabet is using its profitability to continue investing in top growth opportunities like cloud computing.
  • In addition to robust profitability, Alphabet still has some of the deepest pockets on the planet -- cash and short-term investments totaled $125 billion at the end of June 2022 (not to mention another $30.7 billion in long-term investments), offset by debt of only $14.7 billion.
  • Alphabet returned $15.2 billion in cash to investors in Q2 via share repurchases, bringing its first-half 2022 share repurchase total to $28.5 billion.  

With the investing world mired in uncertainty, Alphabet is an absolute bulwark. It's poised to keep expanding thanks to Google Cloud, and sooner or later its profit margins will bounce back too. In the meantime, the company is doubling down on its share repurchases at exactly the time a shareholder would want it to -- after the stock has suffered a 27% loss so far in 2022 and is trading for as cheap as it's been in years.  

Alphabet remains a core position in my portfolio, and I plan to add more after the Q2 update. If you are a long-term investor (with at least a few years before you need the money, but the longer the better), this stock looks like a fantastic buy right now.