The artificial intelligence (AI) market is currently valued at $208 billion and is projected to jump more than 780% to $1.8 trillion by 2030, according to Statista. That immense potential market attracted the attention of many of the world's most valuable companies, all hoping to grab a slice. That potential also means now is a great time to invest in what looks to be a booming industry. 

There are a lot of choices in AI stocks out there, two of the current leaders are Advanced Micro Devices (AMD 1.33%) and Microsoft (MSFT -2.45%). Both tech giants have invested millions into developing the industry, with one showing promise in the hardware side of AI and the other excelling in the software side.

But if you only have room for one AI stock in your portfolio, you'll want to know which of these two is the better buy. Is AMD or Microsoft the better AI stock?

The case for Advanced Micro Devices

AMD share prices are up 27% year to date, largely thanks to its growing position in AI. The company's chips, such as its graphics processing units (GPUs) and central processing units (CPUs), give it vast industry potential. As one of the leading producers of both components, AMD products provide the processing power for a wide variety of AI applications, with its GPUs capable of taking on heavy workloads and its CPUs well-suited for smaller tasks.

The tech giant's biggest competitor, Nvidia, has so far taken the lead in AI by becoming the main supplier of GPUs to OpenAI's ChatGPT. However, AMD is playing the long game, investing heavily in the market by making strategic acquisitions. 

In 2022, AMD acquired Pensando, a company that delivers various services geared toward cloud platforms. AI is already being used to enhance the cloud market, with the purchase of Pensando potentially giving AMD a leg up in the sector. Last year also saw the company acquire Xilinx, which is skilled at developing CPUs for specialized tasks. Xilinx has expanded AMD's AI capabilities with its Vitis AI platform, an advanced development solution for AI software.

Support from Microsoft actually bolsters the argument in favor of AMD's stock. According to a Bloomberg report, the Windows company is working with AMD and supplying engineering resources to boost its AI chip development and create an alternative to Nvidia.

AMD may not be the current leader in AI chip development. However, it has a promising outlook in the industry over the long term, with the potential to eventually trounce the competition. 

The case for Microsoft

Microsoft is one of the most prominent names in AI right now as the biggest backer of start-up OpenAI, investing $1 billion in 2019. And this year, Microsoft invested a further $10 billion in the company after the massive success of ChatGPT.

The partnership allowed Microsoft to integrate OpenAI's technologies into many of its homegrown services. Platforms such as its cloud service Azure, search engine Bing, and Office productivity suite all got AI upgrades over the last few months as a result. 

The biggest benefit of Microsoft's investment in AI comes from becoming the go-to for consumers and businesses requiring AI services. If the company can beat competitors like Amazon and Alphabet to the punch, it could snap up market share and soon dominate the lucrative industry. ChatGPT and other AI tools are already available through Azure, promising assets to attract businesses to its cloud offerings. 

Microsoft's early investment in OpenAI and the potency of brands like Windows, Office, and Azure could see the company skyrocket to the top of AI in the coming years.

Is AMD or Microsoft the better buy?

AMD and Microsoft are both compelling options to invest in the burgeoning AI market. The choice between these two tech giants lies in their profitability potential in the industry and their current stock price. With the AI market still in its infancy, it's too early to know who will dominate the software side of things, as the best applications of the technology probably haven't been invented yet.

As a result, the more reliable investment is in the hardware necessary to develop AI programs, with AMD being the better option in that respect. The company has a massive advantage with its ability to supply chips to the entire market, while Microsoft has to contend with steep competition from other cloud companies.

AMD PEG Ratio Chart

AMD PEG Ratio data by YCharts

Regarding stock value, the chart above suggests that AMD's projected stock growth is not currently priced into its shares. Meanwhile, Microsoft's stock may be overvalued at the moment. An ideal price/earnings-to-growth (PEG) ratio generally lies below 1 as that represents an undervalued stock. A higher PEG often indicates an inflated stock price.

And with that, AMD is the better AI stock, and a no-brainer buy right now.