If there's one picture that every investor in the stock market should have permanently imprinted in their cranium right now, it's a chart of the long-term performance of the S&P 500.

This is the most widely followed stock index in the world. It tracks the shares of the biggest and best corporations in the United States -- from Apple to JPMorgan Chase to AT&T.

An inflation-adjusted chart of the S&P 500 since 1900.

Data source: Robert Shiller's Irrational Exuberance. Chart by author.

Take one look at a chart of the S&P 500 today, and you can't help but be struck by its lofty heights. Stocks are at all-time highs, dwarfing the peaks of the internet and housing bubbles.

This alone doesn't mean that stocks are egregiously overvalued. If you adjust the chart for inflation, as I've done, it looks less ominous. Furthermore, stock prices are a function of corporate earnings, which have grown markedly over the past decade.

But even after earnings are factored into the analysis, stock prices still seem rich. Data collected by Yale University's Robert Shiller shows that the ratio of stock prices to corporate earnings has been higher only twice since the year 1900 -- in 1929 and 2000.

None of this proves that a correction or crash is imminent. But with stocks peering down from their current heights, you would be excused for keeping your cash on the sideline until a more favorable opportunity to buy stocks at lower valuations presents itself.

Offer from The Motley Fool: The 10 best stocks to buy now
Motley Fool co-founders Tom and David Gardner have spent more than a decade beating the market. In fact, the newsletter they run, Motley Fool Stock Advisor, has tripled the S&P 500!*

Tom and David just revealed their ten top stock picks for investors to buy right now.

Click here to get access to the full list!

*Stock Advisor returns as of 1/30/2017

John Maxfield has no position in any stocks mentioned. The Motley Fool owns shares of and recommends AAPL. The Motley Fool has the following options: long January 2018 $90 calls on AAPL and short January 2018 $95 calls on AAPL. The Motley Fool has a disclosure policy.