Advanced Micro Devices (AMD -0.17%) and Nvidia (NVDA 1.75%) have become favorites on Wall Street this year thanks to a boom in artificial intelligence (AI). The industry is swiftly expanding, and hardware from chipmakers like AMD and Nvidia will be crucial to that growth. As a result, AMD's stock gained 74% since Jan. 1, with Nvidia's up 220%.

As the tech industry develops, multiple sectors are seeking high-powered chips to move forward. In addition to AI, markets such as cloud computing, virtual reality, gaming, and more are boosting demand for such hardware. Consequently, many investors are adding a semiconductor company to their portfolio with hopes of profiting from the long-term growth of the tech industry. 

AMD and Nvidia are two of the world's biggest chipmakers, and both are attractive stock options. So, let's assess whether AMD or Nvidia is the better buy in 2023. 

Advanced Micro Devices: Promising expansion plans 

AMD has a long history of offering investors consistent gains, with its stock up 482% over the last five years. The company is in a near-constant state of innovation. This helped push its annual revenue up 265% in the same period and increase operating income 180%.

AMD's growth has come alongside expansions into multiple markets, supplying its chips across tech. The company's hardware can be found in many products, including game consoles, laptops, and data centers. As a result, it's not surprising AMD has plans to invest in India, one of the world's fastest-growing cloud markets. 

The company said it will invest about $400 million in the country over the next five years to build its largest-ever semiconductor design center. India has attracted many of the biggest names in tech in recent years as it strives to become a hub for chip manufacturing. In 2023, Amazon and Microsoft made similar commitments to invest in the high-growth region. 

The expansion is promising for AMD's long-term future as it works to catch up to Nvidia in AI and develop in other markets. 

Nvidia: Dominating the AI chip market

Like AMD, Nvidia has enjoyed massive stock growth since 2018, with its shares rising 667%. Meanwhile, its revenue climbed by 130% and operating income by 47%. The company's powerful graphics processing units (GPUs) have granted it a dominating position in tech and emerging markets like AI. 

Nvidia is currently the biggest name in AI chips, with a market share of about 90%. As a result, many companies have doubled down on chip production in an effort to undercut Nvidia's pricing and steal market share. Tech giants such as AMD, Amazon, and Intel all have AI chip divisions that could soon threaten the company's position.

However, Nvidia's current lead in the industry gives it a massive advantage. If the company can continue to deliver on chip performance and offer competitive pricing, it will be difficult for anyone to dethrone Nvidia. 

Is AMD or Nvidia the better buy?

AMD and Nvidia have cornered the market on chips and enjoyed immense growth as a result. AMD has become a leading name in processors, while Nvidia dominates the GPU market. As a result, both make compelling long-term investments. 

However, when looking at the companies' forward price-to-earnings ratios (P/E), AMD trades at a better value. The chart below shows AMD's forward P/E is significantly lower than Nvdia's. This metric can be a useful way to determine a stock's value as it takes into account a company's forecast earnings and its stock price. The lower the P/E, the better. 

AMD PE Ratio (Forward) Chart.

Data by YCharts

Moreover, Nvidia's market cap of $1.2 trillion compared to AMD's $182 billion potentially indicates AMD's stock has more room to rise, making it the safer option. Alongside a quickly expanding business, AMD is the better buy. However, it's not a bad idea to keep Nvidia on your radar for future investment.