Artificial intelligence (AI) offers many exciting long-term possibilities, but the technology's thirst for computing power is a certainty that's fueled remarkable growth in semiconductors. Chip companies like Nvidia (NVDA -2.09%) and Broadcom (AVGO -1.47%) have soared on the realization that AI is creating billions of dollars in opportunities for each. Since January, both stocks have outpaced the S&P 500, though Nvidia has led the way, up over 180%.

Both companies expect big things in 2025. Nvidia is rolling out its successor to its wildly popular Hopper AI chip architecture. At the same time, Broadcom has recently announced significant AI chip deals that should ignite growth for the next several years.

But which stock is the better buy for 2025? 

Both stocks are AI winners

Nvidia is arguably the household name in AI among investors. The company's expertise in GPU (graphics processing unit) chips translated well to AI. Nvidia's Hopper accelerator chip architecture became the gold standard for technology companies developing AI, which requires lots of computing power to train on vast amounts of data.

The H100 chip remains popular, but Nvidia is rolling out Blackwell chips, the next-generation architecture, to meet the increased demands of smarter AI models. Nvidia CEO Jensen Huang believes Blackwell could be the company's most successful product. Analysts estimate that Nvidia will grow earnings by an average of 38% over the long term, reflecting these high expectations.

Broadcom has a long, successful history in semiconductors, specializing in networking and other connectivity applications. However, it's no longer a pure chip business; the company has diversified into enterprise infrastructure software, now representing approximately 41% of total revenue. Broadcom has also become increasingly involved in AI chips. In fiscal year 2024, its AI-related revenue totaled $12.2 billion, a 220% increase from last year.

Management recently acknowledged multiple blockbuster deals to develop AI inference chips for prominent AI companies (unnamed but rumored to include OpenAI and Apple) using its XPU (extreme processing unit) chips. Broadcom believes its total AI opportunity could range from $60 billion to $90 billion by 2027, with management predicting a substantial market share. Analysts believe Broadcom's long-term earnings growth will average almost 22% annually.

In all, both companies have seemingly found room to thrive in AI.

It could come down to the better value between the two

Since both companies seem well-positioned for growth, the better buy could boil down to which offers the best bang for your buck. The PEG ratio is excellent for this. It compares a stock's valuation to the company's anticipated growth. The lower the ratio, the better the deal you're getting.

For high-quality stocks, I'm generally comfortable buying stocks at PEG ratios up to 2.0 to 2.5. Here is how each company stacks up:

NVDA PE Ratio (Forward) Chart

NVDA PE Ratio (Forward) data by YCharts

Based on these numbers, Nvidia's PEG ratio is 1.2 versus Broadcom's 1.8.

Remember, this ratio only tells you how much you pay for potential growth. Estimates are only that, meaning they could change. A company's future earnings volatility could also impact investors' willingness to pay.

Nvidia is the better value based on numbers. Still, Blackwell could do better or worse than expected, so there is an argument that Nvidia's a riskier stock than Broadcom, a more diverse business.

Is there a winner? This stock is the better buy heading into the new year

Since both stocks trade at PEG ratios comfortably below what I consider reasonable, long-term investors can buy either (or both) today. That said, there is a winner.

I'd probably opt for Broadcom if both stocks traded at similar PEG ratios because it's less dependent on AI. However, Nvidia and its lower PEG ratio seem to appreciate that risk. A 1.2 PEG ratio is a bargain for most stocks, let alone arguably the world's dominant AI company.

It also doesn't seem likely that AI is a fad; there's too much money piling into the sector for that. Meanwhile, Blackwell seems poised to continue Nvidia's dominance, and innovation in AI technology could fuel demand for increasingly complex AI chips beyond that. Therefore, the future looks bright for both companies, but Nvidia is the better buy heading into 2025.