The S&P 500 finished 2023 in spectacular fashion. The index notched nine consecutive weekly increases, its longest win streak since 2004. In total, the S&P 500 soared 24% last year as market sentiment improved amid signs of economic resilience.

Four sectors were primarily responsible for driving the market higher. The technology sector gained 56% and the communications services sector climbed 53%, helped along in many cases by excitement surrounding artificial intelligence. Consumer discretionary rose 40% as cooling inflation led to an acceleration in spending. Finally, industrials increased 18% as business investments in structures and equipment rebounded.

Not surprisingly, the 10 best-performing S&P 500 stocks in 2023 came from those four sectors, as detailed below:

  1. Nvidia: 239% -- technology
  2. Meta Platforms: 194% -- communications services
  3. Royal Caribbean: 162% -- consumer discretionary
  4. Builders FirstSource: 157% -- industrials
  5. Uber: 149% -- industrials
  6. Carnival: 133% -- consumer discretionary
  7. Advanced Micro Devices: 128% -- technology
  8. PulteGroup: 127% -- consumer discretionary
  9. Palo Alto Networks: 111% -- technology
  10. Tesla: 102% -- consumer discretionary

Nine of the stocks listed above have a consensus buy rating among Wall Street analysts (Tesla is the lone exception with a consensus hold rating). But analysts believe Nvidia (NVDA 6.18%) is the single best pick of the bunch in 2024. The stock has a median 12-month price target of $650 per share, implying 37% upside from its share price as of this writing.

Carnival currently ranks second with a 12-month median price target of $21.50 per share, implying 32% upside. And Meta Platforms takes third place with a 12-month median price target of $385 per share, implying 12% upside.

Here's what investors should know about Nvidia.

Nvidia is shaping the artificial intelligence boom

Nvidia is an accelerated computing company that provides hardware, software, and services across four end markets: gaming, professional visualization, data center, and automotive. Its invention of the graphics processing unit (GPU) in 1999 brought revolutionary visual effects to video games and films, and the company still holds a 90% market share in workstation graphics processors.

However, Nvidia redefined itself in 2006 when it introduced CUDA, a programming model that allows its GPUs to function as general purpose processors. That innovation helped the company find purchase in data centers, where its GPUs have become the gold standard in accelerating complex workloads like scientific computing and artificial intelligence (AI).

In fact, Forrester Research has said Nvidia GPUs are synonymous with AI infrastructure, and the company has consistently achieved leading results at the MLPerf benchmarks, which evaluate the training and inference performance of AI hardware, software, and services. That superiority has allowed Nvidia to capture an 80% to 95% market share in machine learning (ML) processors, according to analysts. The company also holds a 95% market share in data center accelerators, according to CFRA analyst Angelo Zino.

Nvidia has solidified its position as the gold standard in AI chips by branching into subscription software and cloud services. It recently launched DGX Cloud, which provides on-demand access to supercomputing infrastructure, software, and pretrained ML models that support the development and deployment of AI applications, including generative AI applications. The service also offers frameworks that address specific use cases across different industries, from manufacturing and logistics to retail and cybersecurity.

DGX Cloud is a particularly momentous development because it unifies and democratizes access to Nvidia AI technologies. To quote Argus analyst Jim Kelleher, "Nvidia stands out, in our view, not only because it participates in so many parts of the dynamic AI economy, but because it has synthesized its offerings into a first-of-its-kind AI-as-a-service delivered through the cloud."

Nvidia reported record results in the third quarter

Nvidia looked exceptionally strong in its fiscal 2024 third quarter (ended Oct. 29). Revenue skyrocketed 206% to $18.1 billion on record sales in the data center segment, and non-GAAP net income increased 588% to $10.0 billion as high-margin software and services accounted for more of total revenue.

The company also reported solid sales growth in gaming and professional visualization, as detailed below:

  • Data center sales soared 279% to $14.5 billion.
  • Gaming sales increased 81% to $2.9 billion.
  • Professional visualization sales jumped 108% to $416 million.
  • Automotive sales ticked up 4% to $261 million.

Nvidia currently values its addressable market at $1 trillion, but that figure should explode as more businesses turn to AI in search of productivity gains. Indeed, a report from Bloomberg Intelligence estimates that generative AI spending alone will compound by 42% annually to reach $1.3 trillion by 2032.

Nvidia stock trades at a reasonable price

Nvidia is well-positioned to grow its business as AI weaves its way into the fabric of daily life. In fact, the Wall Street consensus calls for the company to increase earnings per share 42% annually over the next three to five years. That makes its current valuation of 63 times earnings easier to stomach. Indeed, given its incredible growth, that multiple looks cheap compared to competing chipmakers and cloud infrastructure providers.

Specifically, Nvidia's PEG ratio -- the price-to-earnings multiple divided by expected annual earnings growth -- currently sits at 1.5. That is a big discount to semiconductor stocks AMD and Intel, which sport PEG ratios of 35.6 and 3.6, respectively. It's also a discount to cloud providers Amazon and Microsoft, which have PEG ratios of 2.8 and 2.5, respectively.

As a caveat, 63 times earnings is not cheap, per se. But price-to-earnings multiples must be considered in context. Nvidia is forecast to grow earnings much faster than its peers, so the stock warrants a higher valuation. That said, Nvidia is still a risky investment because the stock could fall sharply if the company fails to meet expectations.

Patient investors should still consider buying a small position today. Shareholders may or may not see the 37% return in 2024 that analysts expect, but Nvidia has become the heart of the current AI boom. That will almost certainly translate into shareholder value over the next five-plus years.