Interest in artificial intelligence (AI) skyrocketed after the launch of OpenAI's ChatGPT in November 2022. The chatbot highlighted how far AI has come, with the potential to advance countless industries, including cloud computing, e-commerce, consumer products, healthcare, education, autonomous driving, and more.

In fact, according to data from Grand View Research, the AI market is projected to expand at a compound annual growth rate of 37% until at least 2030. The market's trajectory would see it exceed a value of $1 trillion before the decade's end. As a result, it's not surprising that numerous AI stocks have soared over the last year.

For instance, Microsoft (MSFT 1.82%) shares have climbed 69% since last January, rallying Wall Street with its 49% stake in OpenAI. The partnership has granted Microsoft access to some of the industry's most advanced AI models, suggesting the Windows company has significant potential in the sector.

However, AI is expanding quickly, presenting dozens of other attractive ways to invest in the industry. Some of these options could have more growth potential than Microsoft, or offer more value.

So forget Microsoft in 2024. Here are two AI stocks to buy instead.

1. Nvidia

Whether you're a casual investor or trade professionally, you're probably aware of Nvidia's (NVDA 6.18%) meteoric rise last year. Its stock soared 239% in 2023 as the company's graphics processing units (GPUs) became the gold standard for AI developers worldwide.

As interest in AI soared, so did demand for GPUs, and Nvidia was perfectly positioned to supply its hardware to the entire market. The company achieved an estimated 90% market share in AI chips alongside soaring earnings.

In the third quarter of fiscal 2024 (which ended October 2023), Nvidia's revenue rose 206% year over year as operating income increased 1,600%. The company profited from a spike in AI GPU sales, represented by a 279% rise in data center revenue.

Nvidia has a powerful position in AI. Competition in the software side of the industry is heating up, with companies like Microsoft and Amazon facing off over leadership in AI cloud services. However, increased competition only means more chip customers for Nvidia, with the company likely to flourish for years.

NVDA EPS Estimates for 2 Fiscal Years Ahead Chart

Data by YCharts

This chart shows that over the next two fiscal years, Nvidia's earnings could hit $24 per share, while Microsoft's may achieve about $15 per share. Multiplying these figures by each company's forward price-to-earnings ratio (Nvidia's 48 and Microsoft's 35) yields stock prices of $1,152 for Nvidia and $525 for Microsoft.

Considering their current positions, these projections would see Nvidia's stock rise 96% and Microsoft's 33% over the next two fiscal years. While both figures are impressive, Nvidia's higher percentage and prominent role in AI make it a more attractive investment this year.

2. Alphabet

As the home of potent brands like Google, Android, and YouTube, Alphabet (GOOGL 10.22%) (GOOG 9.96%) has massive potential in AI.

The company has grown into a tech behemoth, hosting nine products with more than 1 billion users. Its top performers are Google Search, Android, and Chrome. While these services enabled Alphabet to build a lucrative digital advertising business, they could also prove to be assets in its AI expansion.

Last December Alphabet unveiled Gemini, a highly anticipated AI model that is expected to be competitive with OpenAI's GPT-4. The popularity of Alphabet's various services and Gemini could prove to be a powerful combination. With the new model, Alphabet could create a Search experience closer to ChatGPT, offer more effective advertising, introduce new AI tools on Google Cloud, and better track viewing trends on YouTube.

Alphabet surpassed $77 billion in free cash flow last year, significantly more than rivals Microsoft or Amazon. The company's considerable cash reserves strengthen its outlook in AI, as it has the funds to invest heavily in its research and development and overcome potential hurdles.

MSFT PE Ratio (Forward) Chart

Data by YCharts

These charts show Alphabet's stock is also far cheaper than Microsoft's. The company has lower figures in two key valuation metrics: forward price-to-earnings (P/E) and price-to-sales (P/S) ratios. Forward P/E is calculated by dividing a company's current share price by its estimated future earnings per share. Meanwhile, forward P/S divides its market cap by estimated revenue. For both metrics, the lower the figure, the better the value.

Forward P/E and P/S are great ways to determine the value of a company's shares, as they take into account its financial health against its stock price. In this case, Alphabet is a far bigger bargain than Microsoft on both fronts. Alongside considerable potential in AI, Alphabet is a no-brainer buy in 2024.