In the artificial intelligence (AI) space, few names are bigger than Meta Platforms (META -0.05%) and Alphabet (GOOGL 0.23%) (GOOG 0.23%). Both companies are heavily invested in the proliferation of this technology, and each has rewarded shareholders over the long term.

Although both stocks have had a strong run in 2023, each is still well below its all-time highs. With the catalyst of AI on the horizon, which stock makes for a better buy right now? Read on to find out.

Both companies have spent significantly on AI capabilities

Both companies are involved in different parts of the AI value chain. Alphabet has a huge AI tool kit that developers can use to create and implement their AI models.

Furthermore, its cloud computing division, Google Cloud, is vital for anyone trying to use AI. Training AI models requires massive computational resources, and it doesn't make sense for smaller AI users to purchase their own setup. Instead, they can rent computing space from Google Cloud to cost-effectively create their AI solution. 

Meta Platforms is more of an AI researcher focused on how it can improve its products. Although it does have a sizable open-source library of information that developers can use, its stated AI mission is twofold, according to CEO Mark Zuckerberg: "First, the massive recommendations and ranking infrastructure that powers all of our main products -- from feeds to Reels to our ads system to our integrity systems and that we've been working on for many, many years -- and, second, the new generative foundation models that are enabling entirely new classes of products and experiences."

With a focus on improving its ad technology, it makes sense that Meta has completed tasks like creating a speech-to-text and text-to-speech AI model for more than 1,100 languages.

Because of its heavy AI research focus, Meta has built its own Research SuperCluster, allowing it to use internal computational resources instead of going to third parties like Alphabet.

With both companies heavily invested in AI and rolling out different products, it's difficult to tell which will be a winner based on future rollouts. However, we can look at each company's financials and understand how they are trending.

Alphabet and Meta have similar problems

While both companies have massive AI aspirations, the technology isn't tipping the scales for either one. Advertising keeps the lights on for both, but it's not a great industry currently.

Due to economic uncertainty, many businesses have reduced their advertising budgets, directly affecting both Meta and Alphabet.

GOOGL Revenue (Quarterly YoY Growth) Chart

GOOGL revenue (quarterly YoY growth); data by YCharts. YoY = year over year.

With hardly any revenue growth for either company, delivering profit growth is difficult. Even though both have enacted layoffs to save costs, it hasn't overcome their growing operating costs, causing profits to fall.

GOOGL Net Income (TTM) Chart

GOOGL net income (TTM); data by YCharts. TTM = trailing 12 months.

Even though both companies have great AI aspirations, they aren't doing the best right now. But that doesn't mean the future isn't bright. In 2024, Wall Street analysts expect Alphabet and Meta to grow their revenue by 11% each. So while the ad market is down temporarily, recovery is in sight.

As for valuation, Meta trades at a slight premium using trailing valuation metrics, but when forward earnings are considered, they are valued about the same.

GOOGL PE Ratio Chart

GOOGL PE ratio; data by YCharts. PE = price to earnings.

With not a lot separating these two, which is the better buy? To me, it's clearly Alphabet. While Meta has good AI aspirations, it's aimed more at improving its internal technologies. Alphabet has the same plans to improve internal systems, but it also has products that developers pay for to create their AI models.

Google Cloud is critical in AI, and even without an AI catalyst, saw tremendous growth in Q1, with revenue rising 28% to $7.5 billion. This segment has the potential to explode higher with increased AI demand, as it is far cheaper for companies to obtain resources from Google Cloud instead of purchasing their own setup. Cloud computing has a massive growth trajectory, with one research firm projecting it to reach a $2.4 trillion market opportunity by 2030. With Alphabet controlling an estimated 10% of the cloud computing market, that's a massive amount of growth ahead for Alphabet.

Because of that, Alphabet has greater growth potential than Meta looking out over the next decade. Therefore, I think Alphabet is the better stock to buy right now.