The S&P 500 has been scorching hot over the past year. The broad market index has rallied nearly 28%. That has it trading at an all-time high.

However, not all stocks participated in the rally. Energy stocks are up only about 1% over the past year, so the sector trades at a historically low valuation. That suggests energy stocks have significant upside potential during the next sector rotation.

Scraping the bottom of the valuation barrel

The energy industry currently has a historically low weighting in the S&P 500:

A slide showing the historically low valuation of the energy sector.

Image source: Devon Energy.

That chart shows that energy stocks make up less than 4% of the S&P 500 by market cap. That's the second lowest level over the past few decades, including less than during the dot-com bubble. Because energy stocks supply 10% of the S&P 500's earnings, the sector should have around a 10% weighting since it has historically tracked its earnings contribution. That would put it near the historical average.

Rick Muncrief, the CEO of oil and gas producer Devon Energy (DVN 0.19%), discussed the energy sector's currently compelling value proposition on its fourth-quarter conference call. He commented on what's likely driving the gap, stating, "I believe this gap exists due to extreme valuations in tech, combined with a pervasive misunderstanding of hydrocarbon demand over time."

Whereas energy stocks have barely budged over the past year, tech stocks have rallied more than 50%, driving much of the S&P 500's rebound. Many technology companies trade at extremely frothy valuations today, driven by the hype surrounding artificial intelligence. For example, the tech-heavy Nasdaq 100 currently trades at a forward P/E ratio of more than 30, while the S&P 500 sells for about 21 times forward earnings. Both indexes have seen significant multiple expansion over the past year. The Nasdaq 100's P/E ratio was less than 25 a year ago, while the S&P 500's was around 18.

The other factor weighing on energy stocks is the misplaced belief that demand for oil and gas is declining. That's not the case. Muncrief noted that: "With global energy demand forecasted to increase 50% by 2050, the world is going to need growth from all sources of energy, including oil and natural gas. With the world's power needs continuing to grow, it is evident that peak oil demand is nowhere in sight and our industry will be an important contributor of energy growth for the foreseeable future." Valuations in the energy sector should reflect this growth, not the decline that the market is currently pricing in for most energy stocks.

Drilling for value in the energy sector

Devon Energy is a prime example of the valuation disconnect. The oil company is on track to grow its free cash flow by 20% this year, fueled by service cost deflation and capital efficiency gains. That assumes oil averages about $80 per barrel, which is slightly above the current price point. Even at a more conservative $75 a barrel (slightly below the current price), Devon Energy trades at a free cash flow yield of 9%. That compares to 4% for the S&P 500 and 3% for the Nasdaq, meaning it's significantly cheaper. This discount is driving Devon's capital return strategy of prioritizing share repurchases in 2024 to capitalize on its dirt cheap stock.

Fellow oil and gas producer Diamondback Energy (FANG 0.32%) also trades at a dirt cheap price. At $70 oil, Diamondback can produce more than $15 per share of free cash flow. That puts its free cash flow yield at more than 8%. Meanwhile, it can generate over $19 per share in free cash flow at $80 oil, giving it a free cash flow yield above 10%. That is a cheap price for a growing business. The company expects its oil production to grow by 5% per share this year, while free cash flow could rise more than 15% per share if oil averages around $80 a barrel.

Commodity-priced exposed producers aren't the only energy stocks trading at low valuations. Natural gas pipeline giant Kinder Morgan (KMI -0.64%) expects to grow its free cash flow by 8% this year to $2.26 per share. That gives it a monster 13% free cash flow yield. Kinder Morgan uses half its steady cash flow to pay dividends (currently yielding 6.5%). It uses the rest to fund investments to grow its cash flow, repurchase its dirt cheap shares, and strengthen its already excellent balance sheet. The company expects to grow its cash flow as it capitalizes on the expected 19% rise in natural gas demand through 2030.

A potentially historically attractive entry point

Energy stocks trade at low valuations as investors bid up tech stocks and overlook the growth ahead for the sector. That makes the industry look very attractive. Valuations should improve as investors eventually realize that plenty of growth remains ahead for oil and gas demand and start rotating out of high-octane tech stocks. As that happens, energy stocks could soar.