The move to limit global warming is having a material impact on energy companies. On the one hand, the world still needs oil, and will for a long time to come. On the other hand, well, oil companies clearly need to change with the world around them, or they risk becoming obsolete as the world slowly moves toward cleaner energy sources. Given that backdrop, here's why Shell (RDS.A) (RDS.B) and TotalEnergies (TTE -0.44%) are two of the top oil stocks for investors to buy for the long haul.

The balancing act

Shell and TotalEnergies are both integrated oil giants. That means they own assets across the energy sector, from drilling for oil and natural gas (upstream), to moving these fuels around (midstream), to processing the fuels into chemicals and refining them into gasoline and jet fuel (downstream). This diversification offers balance to their portfolios and helps to smooth the inherent volatility of the energy markets since the downstream often benefits when oil prices are low. As a result, an integrated oil major is probably the best way to invest in the energy sector for more conservative investors.

Two people in silhouette with oil rigs.

Image source: Getty Images.

Shell and TotalEnergies, meanwhile, have seen the writing on the wall when it comes to the world's shift toward cleaner alternatives. Both have long been investing in electricity generation, renewable power, and electric vehicle charging stations. They recognize that they need to adjust to the world, or they risk getting left behind. However, it's a balancing act because oil and natural gas aren't suddenly going to stop being used. This transition will take time. 

For example, by 2040, oil's percentage share of the world's energy production will likely fall a few percentage points while natural gas inches up a single percentage point. However, because of increasing energy demand in emerging markets, the total demand for energy is expected to increase. So the total amount of both oil and natural gas used will likely grow even as their combined percentage share shrinks.

That's actually the opportunity here. Basically, Shell and TotalEnergies can use their cash cow energy operations to fund the acquisitions and capital investments that will help them adjust to a cleaner future. But these two oil companies aren't the same.

Dividends or dividend growth?

For dividend investors in search of income, TotalEnergies and its 6.4% dividend yield (the highest of its energy major peers) is probably the better option here. When oil prices plunged in 2020, thanks to the economic shutdowns used to slow the spread of the coronavirus pandemic, it was the only oil major to announce the price level (an average of $40 per barrel) at which it could maintain its dividend. 

It made very clear that it understood how important the dividend was to its investors and that it would make the transition to cleaner alternatives while doing everything in its power to maintain the dividend. With energy prices rebounding from their lows, the company's plan to triple the size of its "electrons" business hasn't changed, but it has suggested that dividend increases are a possibility. However, investing in the business and maintaining a solid balance sheet both come first. That means investors shouldn't go in expecting regular dividend hikes, making TotalEnergies appropriate for investors seeking to maximize the income they generate today.

RDS.B Dividend Yield Chart
Data by YCharts.

Sitting at the other end of the spectrum is Shell, with a yield of around 3.7% (the lowest of its closest peers). That's partly because Shell cut its dividend at the start of 2020, at just about the same time it announced plans to shift its business model toward cleaner alternatives. It was a major reset, but one that the company said would allow it to get back to dividend growth over time. And Shell wasted little time on that front, actually increasing its dividend for the first time in 2020, with another couple of hikes in 2021. 

So Shell is basically a way to play the energy transition away from oil while also benefiting from dividend growth. It's not exactly clear what dividend growth rate investors should expect here -- originally the call was for slow and steady, which seemed logical. However, the most recent hike was 38%. Don't expect that to happen again, as it was most likely a second reset (in the opposite direction), given that the energy market stabilized fairly quickly and allowed Shell to make fairly quick progress on fortifying its balance sheet. Essentially, look for low-to-mid-single-digit dividend growth as Shell uses oil profits to fund clean energy investment. But for dividend growth investors, that's probably a solid trade-off.

Still important

It would be nice if we could flip a clean energy switch and stop using oil and natural gas, but that's just not possible. However, it doesn't make sense to ignore the energy transition that's taking place, either. For dividend investors, Shell and TotalEnergies are ways to benefit from the still-strong demand for oil while hedging your bets on the clean energy side. Shell has a dividend growth bent to it, while TotalEnergies is a strong high-yield option.