After enduring the fourth-worst year in its history, the Nasdaq 100 (NDAQ 0.05%) index is roaring back to life. The tech-heavy index finished out 2022 with losses of nearly 33%, its steepest loss since 2008.

But as of May 18, the Nasdaq 100 was up 27% year to date in 2023. The index has now recovered about half of its losses. Still, you may be wondering whether these gains will continue -- or if the stocks in the Nasdaq 100 will come tumbling down again. Keep reading to learn whether it's safe to invest in the Nasdaq 100 right now.

Worried person looking at laptop.

Image source: Getty Images.

What is the Nasdaq 100, and why is it up 27%?

The Nasdaq 100 is a widely followed stock index that tracks the performance of 100 of the largest non-financial companies (based on market capitalization) that trade on the Nasdaq stock exchange.

It's less diversified than the S&P 500 index, which is widely used as a benchmark for the performance of the U.S. stock market. Tech stocks account for about 60% of the Nasdaq 100's value. By comparison, just over a quarter of the S&P 500's value is concentrated in the tech sector. 

The top five Nasdaq 100 index sectors are:

1. Technology (60.28%)

2. Consumer discretionary (18.61%)

3. Health care (5.98%)

4. Industrials (4.59%)

5. Telecommunications (4.36%)

The Nasdaq 100 has outperformed the S&P 500 thus far in 2023, with 27% gains compared to about 10% for the S&P 500. But the Nasdaq 100 had significantly steeper losses to recover from after tech stocks tanked last year. The S&P 500's losses of about 18% in 2022 paled in comparison to the 33% nosedive the Nasdaq 100 took in the same year.

There are a number of reasons investors have been bullish about the tech sector in 2023. There's excitement about artificial intelligence and the increasing adoption of cloud computing. Cooling inflation has generated optimism that the Fed will slow down or pause interest rate hikes. Plus, many investors have realized that a lot of promising companies are available at a bargain.

Plus, unlike the S&P 500, the Nasdaq 100 doesn't include financial stocks. Due to the banking crisis that began in March with the collapse of Silicon Valley Bank, the financial sector has been among the worst performers of 2023. 

Is it safe to invest in the Nasdaq 100?

The short answer is yes. It's safe to invest in the stocks that make up the Nasdaq 100 -- as long as you have a long time horizon.

Historically, the Nasdaq 100 has smashed the S&P 500 in terms of returns. But tech stocks tend to be more volatile than the overall stock market and perform especially poorly during recessions.

Chart showing the Nasdaq 100 performing better than the S&P 500 since 2010.

^NDX data by YCharts

Potential short-term volatility shouldn't concern you too much if you don't expect that you'll need your money for five to 10 years. But if your retirement date is approaching, choosing a more diversified investment, like an S&P 500 fund, is typically a safer bet.

How can you invest in the Nasdaq 100?

It's not possible to invest directly in the Nasdaq 100 or any other stock index. Instead, you invest in the stocks represented in the index. But buying shares in 100 different companies is far too complicated for any retail investor.

Fortunately, there's an easier way. You can invest in an exchange-traded fund (ETF) that closely tracks the index's performance. One popular choice is the Invesco QQQ Trust (QQQ -0.89%). Had you plunked $10,000 into the QQQ 10 years ago, your investment would be worth just over $50,000 today. Its expense ratio is just 0.2%, meaning just $2 of a $1,000 investment would go toward fees.

Investing in the high-growth stocks in the Nasdaq 100 could bankroll your portfolio. But before you invest, think carefully about whether you can stomach the short-term ups and downs.