Thanks to the emergence of artificial intelligence (AI), Alphabet (GOOGL -1.97%) (GOOG -1.96%) has been in the news a lot lately. Shareholders are wondering what AI means for the future of one of the leading companies in the digital sector. So far, it must be a positive view, as shares are up 39% this year and 18% in the past month (as of May 19). 

Does this momentum mean Alphabet stock is a buy right now? I think the answer to that question is really easy. Here's why this megacap tech stock deserves a place in your portfolio. 

Alphabet's valuation 

Alphabet has crushed the Nasdaq Composite Index's 21% gain in 2023. And over the past five years, the dominant tech enterprise has produced a return of 130%, translating to an annualized gain of 18%. That's a remarkable performance. And it has been spurred by rising sales and profits. 

Despite being a winning investment, shares only trade at a price-to-earnings ratio of 27. For a company as powerful and profitable as Alphabet, I don't think this valuation is asking investors too much. For what it's worth, Alphabet's stock is currently cheaper than Apple and Meta Platforms, both at about a P/E of 30 (as of this writing).  

Handling the threat of AI 

Investors are known to overreact in the short term and underreact in the long term. I think this applies to the emergence of AI and its potential impact on Alphabet's business. Investors are worried that Microsoft's Bing search engine, now powered by ChatGPT, will steal share away from Google Search, the undisputed leader in the industry and Alphabet's cash machine. But the evidence doesn't suggest this is happening. 

Warren Buffett recently said the power of Apple is that you could offer to pay someone $10,000 to never use an iPhone again, and that person would likely turn down that offer. I think the same thing might apply to Google Search. I'm guessing some would ask for a lot of money if they couldn't use Google ever again, which highlights how important it is to people's everyday lives.

Moreover, at its recent I/O conference, Alphabet announced plans to incorporate AI across its range of products. Investors cheered the news. 

Growing cloud business 

Behind first-place Amazon Web Services and second-place Microsoft Azure, which combined command about 55% of the cloud industry, according to Statista, there's Alphabet's offering, known as Google Cloud Platform (GCP). In the first quarter (ended March 31), GCP registered revenue of $7.5 billion, good for a 28% year-over-year jump. This gain beat the 16% sales increase of AWS, a sign that GCP could be taking some market share. 

A positive development in the latest quarter was that for the first time, GCP produced positive operating income. To be clear, there were some segment costs that were reallocated across the business, but it's still a noteworthy milestone for what has been a loss-making service. Some of GCP's major clients include household names like PayPal, Home Depot, and Procter & Gamble, an obvious indicator of its adoption thus far. 

The worldwide cloud market is expected to be worth a massive $1.6 trillion in 2030. This leaves a huge opportunity for GCP to boost its revenue throughout the rest of the decade. 

YouTube is a leader in entertainment 

If AI didn't steal all the spotlight, investors would be more focused on how intense the competition is in the streaming industry. Netflix and Walt Disney get a lot of the attention, but Alphabet has a dog in the fight as well: its popular YouTube service.

According to data from Nielsen, YouTube attracted the most TV viewing time of any other streaming service in the U.S. in the month of April. This shows its dominance. 

While not reported by the company, it's estimated that YouTube has 2.5 billion monthly active users. The service generated $29.2 billion of ad revenue in 2022, slightly below what Netflix posted in sales last year. And this figure doesn't include subscriptions for YouTube TV. The addition of NFL Sunday Ticket should help attract even more customers to the platform. 

Taking all of these positive attributes together, it's almost impossible not to like Alphabet shares today.