Big oil companies have long touted hydrogen energy as a way to reduce carbon emissions. Now they are grappling with how to make that a reality.

BP PLC, Royal Dutch Shell PLC and TotalEnergies SE are all pursuing multimillion-dollar hydrogen projects, often with government support, as they seek to redefine their future role in a world less reliant on fossil fuels. Hydrogen made using renewable energy can be produced and used without emitting carbon dioxide.

Still, experts say there are various hurdles to the light, colorless gas fulfilling its potential. Firstly, most hydrogen today is made from fossil fuels, primarily natural gas. The challenge is to make it using renewable power instead and produce it on an industrial scale, in the hope of bringing down costs. Additionally, hydrogen is explosive, as well as difficult to store and transport.

Oil companies are pursuing green hydrogen, which they see as a longer-term goal, while also looking at applying carbon-capture technology to fossil-fuel-based hydrogen production as a way to clean up the gas in the interim.

A hydrogen fuel pump at a Shell station in Sindelfingen, Germany.

A hydrogen fuel pump at a Shell station in Sindelfingen, Germany.

Photo: Alex Kraus/Bloomberg News

As of the end of June, there were 244 large-scale green hydrogen projects planned, according to the Hydrogen Council, an industry group, up more than 50% since the end of January. It estimates tens of billions of dollars have already been earmarked for hydrogen projects.

Historically used to help make fertilizer and chemicals, hydrogen is increasingly being pushed for a much broader range of uses, including for trucks, planes, ships, household heating and as a way to store renewable power.

“Today, hydrogen is used as a feedstock primarily…the growth of the hydrogen market is all about it becoming an energy source,” said Louise Jacobsen Plutt, BP’s senior vice president of hydrogen and carbon capture and storage.

BP is exploring the use of hydrogen to replace natural gas in industries such as steel, cement and chemicals, and also as a substitute for diesel in trucks. Overall, BP forecasts hydrogen could account for about 16% of the world’s energy consumption by 2050—if net zero carbon-emissions goals are to be achieved—up from less than 1% today.

Like other major oil companies, BP thinks its existing expertise—it already produces hydrogen at refineries—and infrastructure could help it win a sizable market share. Last year the company said it planned to use wind power to produce hydrogen for a refinery in Germany, hoping to demonstrate the technology at a large scale.

However, BP doesn’t expect green hydrogen to be a material part of its business until the 2030s, and it has yet to make a final investment decision on any new hydrogen projects. It will take time to create a market and bring down the cost, Ms. Jacobsen Plutt said, “Because it is so nascent, it is more expensive.”

Shell also is grappling with high costs. This month, the company started up what it said is Europe’s largest green hydrogen plant, to supply its Rhineland refinery in Germany. But that hydrogen is between five and seven times more expensive than the fossil-fuel-based product it predominantly uses.

“You’re not in the money yet,” said Paul Bogers, Shell’s vice president of hydrogen. “For green hydrogen, the core belief is that you almost have to get to a world where the electrons are free.”

Industry executives say green hydrogen is expensive because of the cost of the electricity needed to make it, as well as the cost of the electrolyzer—the system used to split water into hydrogen and oxygen.

Shell hopes it can reduce costs by building hydrogen projects in strategic locations alongside customers’ plants, like at ArcelorMittal SA’s steel mill in the German port of Hamburg, where it can also add hydrogen refueling for trucks.

The industry is also getting government support. The European Union paid half the roughly $23 million cost of Shell’s Rhineland project and has earmarked funding for hydrogen as part of its pandemic recovery program.

Some of the world’s largest companies are exploring hydrogen as a potential solution to growing energy needs. WSJ’s Neanda Salvaterra investigates whether harnessing the most abundant element in the universe can really mark the end of the fossil fuel era. Photo/Video: Jaden Urbi/The Wall Street Journal The Wall Street Journal Interactive Edition

In the U.S., the Energy Department has said it aims to reduce the cost of green hydrogen by 80% to $1 per kilogram in the next decade, in part by supporting pilot projects.

Consultants and oil company executives say an interim step to reaching large-scale green hydrogen production is to capture and store carbon generated by making hydrogen from natural gas to reduce emissions—making what is known as blue hydrogen.

Critics of fossil-fuel hydrogen where carbon is captured say the process is expensive, and that extracting and transporting natural gas often results in greenhouse gas leaks, meaning any hydrogen produced likely won’t be zero-carbon.

Oil-and-gas companies want to pursue this approach because it “could extend the life of their fossil assets,” said Cameron Hepburn, director of the Smith School of Enterprise and Environment at the University of Oxford.

Some U.S. oil companies also are pursuing hydrogen.

Chevron Corp. has signaled that it sees hydrogen having a role in transportation, as an industrial feedstock and in energy storage. This month, it partnered with engine maker Cummins Inc. to explore hydrogen infrastructure and fuel-cell vehicles, following a similar agreement in April with car maker Toyota Motor North America Inc.

Amid the enthusiasm, there needs to be greater focus on where best to deploy green hydrogen, said Michael Liebreich, chief executive of consulting firm Liebreich Associates. The priority should be to replace gas-based hydrogen for tasks like making fertilizer and in hard-to-abate industries such as steel, aviation and shipping, Mr. Liebreich said, adding that it makes less sense where electricity could be used directly, like in domestic heating, cars and trains.

One area where there is an active debate around the merits of switching to hydrogen is long-distance trucking.

In recent months, Volkswagen AG’s Scania brand has scaled back its hydrogen research to focus on batteries instead, saying hydrogen trucks require three times as much electricity, while Daimler Truck AG and Shell agreed to jointly push the adoption of hydrogen fuel-cell trucks in Europe, pledging to roll out 150 refueling stations.

Tom Baxter, a visiting professor in chemical engineering at Scotland’s University of Strathclyde, said it is too early to judge what role hydrogen could play in areas such as aviation and shipping, and that he is skeptical about some of the other new uses being touted.

“For big trucks going across the [U.S.] or Australia hydrogen might have a role, but it’s niche,” Mr. Baxter said. “Setting hydrogen alongside the alternatives that we have, particularly electrification, it’s there that the hydrogen story starts to unravel.”

Write to Sarah McFarlane at sarah.mcfarlane@wsj.com