As the tech market develops, demand for powerful chips is soaring. Countless industries including gaming, artificial intelligence (AI), cloud computing, and virtual/augmented reality (VR/AR) require more-advanced hardware. As a result, chipmakers like Advanced Micro Devices (AMD -0.87%) and Nvidia (NVDA -1.72%) could see earnings soar over the long term, making their stocks attractive. 

These two companies became favorites on Wall Street in 2023, with AMD's stock up about 76% and Nvidia's up around 189% since Jan. 1. Investors grew bullish over their prospects in AI as the sector is projected to expand at a compound annual rate of 37% in the coming years. And AMD and Nvidia are two of the biggest names producing chips capable of developing and running AI models. 

So let's look at these tech giants to determine whether AMD's or Nvidia's stock is the better buy.  

Advanced Micro Devices

The launch of OpenAI's ChatGPT last November shined a spotlight on AI and made tech enthusiasts rethink what was possible with the technology. The chatbot's ability to produce human-like dialogue triggered a boom in which many of the biggest tech companies rushed to join the industry. Nvidia's position as the primary supplier of graphics processing units (GPUs) to ChatGPT made it look miles ahead of AMD in AI.

As a result, AMD has spent the first half of this year playing catch-up. The company partnered with OpenAI's biggest investor, Microsoft, to bolster its AI chip expansion. The Windows company is reportedly providing financial and engineering support, aiming to create an alternative to Nvidia. 

And AI software firm MosaicML recently tested AMD's MI250 and Nvidia's A100, both chips being one generation behind each company's flagship versions. The evaluation revealed AMD's hardware has 80% of the performance of Nvidia's. However, MosaicML also said software updates currently in development should soon boost AMD's performance to match Nvidia's.

AMD might still be behind Nvidia, but its long-term prospects are strong. And AMD has massive support from different tech companies, as increased competition will lead to lower prices for AI chips. 

Nvidia

According to a recent Reuters report, Nvidia has between 80% to 95% market share in AI chips. Competition from AMD and Intel is growing, but Nvidia's advanced GPUs will make it difficult to dethrone the company completely. 

Nvidia's dominance in the sector has substantially boosted its business and given it a new direction. In 2022, the company's shares fell 50% as macroeconomic headwinds brought steep declines in the personal computer market. Before this year, Nvidia was best known for its consumer GPUs that had seen immense success as gamers used the company's components to build custom PCs. 

However, last year's economic challenges led to reductions in consumer spending, and Nvidia's highest-earning segment shifted from gaming to data centers. Advances in AI and partnerships with cloud providers like Amazon Web Services saw Nvidia's data center segment report a revenue rise of 41% in fiscal 2022, hitting $15 billion. 

The company has become the go-to chip supplier in one of the most lucrative industries of the year. Its collaboration with ChatGPT led it to similarly supply GPUs to Alphabet's competing platform, Bard. Whether the competition catches up or not, Nvidia still has much to gain from the quickly expanding industry. 

Is AMD or Nvidia the better buy?

As the biggest names in AI chip design, AMD and Nvidia are excellent long-term options. Consequently, deciding which is the better buy lies in which is currently trading at a better value. 

NVDA Price to Free Cash Flow Chart

Data by YCharts.

The chart above displays two helpful metrics when determining a stock's value: forward price-to-earnings (P/E) ratio and price to free cash flow (P/FCF). In both cases, AMD comes out on top, with its forward P/E and P/FCF significantly lower than Nvidia's, suggesting its stock offers more value.

AMD might be behind Nvidia in AI, but its market cap of $183 billion compared to Nvidia's $1 trillion indicates it could have more room to rise in the short term and be a less-risky investment. Alongside a cheaper-priced stock, AMD is the better and more reliable buy right now.