The U.S. stock market is often divided into three major indexes, all of which moved higher over the past year as recession fears diminished. The S&P 500 (^GSPC 1.02%) advanced 27%, the Dow Jones Industrial Average (^DJI 0.40%) advanced 18%, and the Nasdaq Composite (^IXIC 2.02%) advanced 40%.

However, one-year returns tell investors very little. Vanguard founder John Bogle once wrote, "Reversion to the mean is a rule of life in the investing world." He compared the phenomenon to gravity. An index may outperform or underperform its historical average during certain periods, but performance is typically pulled back to the average over time.

Read on to see how all three major indexes performed over the past 20 years.

The S&P 500

The S&P 500 was expanded to include 500 stocks in 1957, but its predecessor was created 1923. The S&P 500 tracks 500 large U.S. companies that represent a blend of value and growth stocks. Its constituents account for about 80% of domestic equities by market capitalization, so investors often treat the index as a benchmark for the entire U.S. stock market.

The largest components of the S&P 500 index are listed below:

  1. Microsoft: 7.2%
  2. Apple: 6.6%
  3. Alphabet: 3.8%
  4. Nvidia: 3.7%
  5. Amazon: 3.5%

The S&P 500 returned 345% over the last two decades, compounding at 7.7% annually. But with dividends reinvested, the S&P 500 delivered a total return of 546% over the same period, compounding at 9.8% annually. Investors can get direct, inexpensive exposure to the index with a fund like the Vanguard S&P 500 ETF.

Index funds lack the excitement of individual stocks, but the S&P 500 has outperformed virtually every other asset class over the last five, 10, and 20-year periods, according to Morgan Stanley. That includes equity markets in Europe, Asia, and emerging market economies. It also includes U.S. fixed-income and international bonds, as well as real estate and precious metals.

In short, investors are unlikely to find a more favorable risk-reward profile. As a result, Wall Street legend Warren Buffett has consistently recommended buying an S&P 500 index fund.

The Dow Jones Industrial Average

The Dow Jones Industrial Average measures the performance of just 30 U.S. companies. They are generally included in the S&P 500, but selection is limited to companies that satisfy three conditions: (1) excellent reputation, (2) sustained earnings growth, and (3) widespread interest among investors. The index is commonly viewed as a benchmark for blue chip stocks.

The five largest components of the Dow Jones Industrial Average are listed below:

  1. UnitedHealth Group: 8.9%
  2. Microsoft: 6.7%
  3. Goldman Sachs: 6.6%
  4. Home Depot: 6.2%
  5. Caterpillar: 5.4%

The Dow returned 268% over the last two decades, or 6.7% annually. Investors can tap into the index with the SPDR Dow Jones Industrial Average ETF, though that index fund is unlikely to outperform the S&P 500 over long periods simply because the Dow prioritizes quality over growth.

However, for that same reason, the Dow has historically been less volatile than the S&P 500. Specifically, its five-year beta is 0.94, meaning the fund moved 94 basis points for every 100-basis-point movement in the S&P 500 during that time period.

The Nasdaq Composite

The Nasdaq Composite measures the performance of more than 3,000 companies, all of which trade on the Nasdaq Stock Exchange. The index is heavily weighted toward the technology sector, so it's commonly viewed as a benchmark for tech stocks.

The five largest components of the Nasdaq Composite are listed below:

  1. Microsoft: 12.1%
  2. Apple: 11.7%
  3. Alphabet: 6.7%
  4. Amazon: 6.5%
  5. Nvidia: 6.2%

The Nasdaq Composite had the strongest 20-year performance after rising 687%, or 10.9% annually. The Fidelity Nasdaq Composite ETF is one way to invest in the index.

The Nasdaq Composite has consistently outperformed the broad-based S&P 500 and the blue-chip Dow over long periods due to its concentration in technology and consumer discretionary stocks, the two best-performing stock market sectors over the last 20 years.

However, the Nasdaq Composite has also been more volatile than the other two indexes. The Fidelity Nasdaq Composite ETF carries a five-year beta of 1.12. Investors can expect similar outperformance and volatility in the future.