Interest in artificial intelligence (AI) has skyrocketed this year, prompted by the launch of OpenAI's ChatGPT in November 2022.

This technology has the potential to improve countless industries, from cloud computing to productivity software, healthcare, education, and more. As a result, the AI market is projected to expand at a compound annual growth rate of 37% through 2030, exceeding $1 trillion before the decade's end (per Grand View Research).

Companies across tech have pivoted their businesses to the budding industry, creating several attractive ways to invest in the sector. Nvidia (NVDA -4.57%) and Microsoft (MSFT 1.23%) are two attractive options, with both companies holding powerful positions in AI. These companies could see considerable gains from the market in the new year, making their stocks attractive options as 2023 comes to a close.

So, let's consider whether Nvidia or Microsoft is the better stock to invest in artificial intelligence for 2024.

Nvidia

As a leading chipmaker, Nvidia creates the hardware necessary to train and run AI models. The company is massively profiting from an uptick in demand for graphics processing units (GPUs), which has seen its stock climb 237% this year.

In the third quarter of its fiscal 2024 (which ended October 2023), Nvidia posted revenue growth of 206% year over year and a 1,600% spike in operating income. The immense growth was mainly attributed to a 279% increase in its data center segment, reflecting a significant rise in AI GPU sales.

Nvidia has dominated the GPU market for years, while competitors like Advanced Micro Devices and Intel have primarily focused on central processing units (CPUs). Consequently, Nvidia was well-positioned to take full advantage of the boom in AI, snapping up an estimated 90% market share in AI chips since the start of 2023, while its peers have yet to catch up.

Several chipmakers have plans to launch new AI GPUs in 2024. However, the market is expanding quickly, with increased competition unlikely to make a significant dent in Nvidia's projected growth.

Microsoft

Like Nvidia, Microsoft was an early investor in AI. The company sunk $1 billion in OpenAI in 2019 and has since increased that investment to achieve a 49% stake in the start-up. The partnership has granted Microsoft exclusive access to some of the most advanced AI technology, which the tech giant has used to introduce AI features across its product lineup.

Over the past year, new AI tools have been added to the company's Azure cloud platform, ChatGPT-like features have been introduced to its Bing search engine, and AI upgrades have been brought to many of its Office productivity services.

And Microsoft has already begun making moves to monetize its venture into AI. In March, Microsoft 365 unveiled Copilot, an AI assistant that members can use for $30 on top of the regular cost of a subscription. The company's command of the productivity and cloud markets gives it massive earnings potential in AI, which will likely see its revenue soar next year and beyond.

In fiscal 2024's first quarter (ended September 2023), Microsoft posted revenue growth of 13% year over year, beating analysts' expectations by $2 billion. Meanwhile, it hit over $63 billion in free cash flow this year.

The company is on a promising growth path, with the funds to continue investing in R&D and expand its role in AI.

Is Nvidia or Microsoft the better AI stock for 2024?

NVDA EPS Estimates for Next Fiscal Year Chart

Data by YCharts

Nvidia and Microsoft have lucrative positions in artificial intelligence, with one killing it in hardware and the other cornering the market on software tools. They're both compelling investment options for the new year. However, the charts suggest Nvidia could have more to offer stockholders.

Nvidia's earnings could hit $24 per share over the next two fiscal years, while Microsoft's will potentially reach $15 per share. Multiplying these figures by their respective forward price-to-earnings ratios (Nvidia's 40 and Microsoft's 33) yields a stock price of $960 for Nvidia and $495 for Microsoft.

Based on their current positions, these figures indicate Nvidia's stock could rise 95% over the next two fiscal years, while Microsoft's has the potential to increase by 32%. As a result, Nvidia looks like the better AI stock for 2024 and the following year.