Though hydrogen fuel eliminates tailpipe pollution, most hydrogen fuel is made from natural gas, a fossil fuel. It is possible to make it from a cleaner source: water. With electrodes in water, electricity can split the hydrogen from oxygen, giving you pure hydrogen. But until now, the processes have relied on purified freshwater, which is expensive. For the use of hydrogen fuel to scale up, we need a different source, one that’s cheaper and doesn’t use up water we could be drinking instead.

Now new research from Stanford scientists demonstrates a new method for making hydrogen fuel directly from ocean water. “Right now, the need for hydrogen is still relatively limited because the so-called hydrogen economy hasn’t taken off yet, although it’s in its early growing stage,” says Hongjie Dai, a chemistry professor at Stanford and coauthor of a new paper about the research. “You could imagine there would be more demand for hydrogen.”

Hydrogen-powered cars are already on roads, and a hydrogen-powered train is now running in Germany. A hydrogen-powered ferry is coming to San Francisco this year, and a project in Norway is designing a zero-emissions cargo ship. A startup in Singapore is developing the first regional hydrogen-electric airplane. “If in the future hydrogen-powered vehicles or other machines are really taking off, you would need a lot of hydrogen, and then you would start to think about where you get that hydrogen,” Dai says.

In the future, ships running on hydrogen fuel cells could make their own fuel directly from seawater, replacing the dirty fuel, called bunker, that they use today. (By one estimate, a single large container ship can produce as much cancer-causing pollution as 50 million cars, along with greenhouses gases.)

Others, including the U.S. Navy, have experimented with making hydrogen from seawater in the past. Alphabet’s Moonshot Factory experimented with another method, and then decided to kill the project. The Stanford researchers tested a method that uses simple electrolysis with a couple of tweaks. In saltwater, the positive electrode would normally attract chloride, quickly decaying the metal. By adding a new coating, the electrode can last longer. It also meant that the team could use 10 times more electricity with its device, generating hydrogen faster. The researchers also made the design energy efficient. And the process can run on renewable electricity.

The research is at an early stage, but Dai says that companies are interested in licensing the technology. The fuel could theoretically be widely used in transportation, from cars to planes; because the process also produces oxygen, it could also be used on submarines, where it could supply fuel for the ship and oxygen for the people on board. (Divers could also potentially use the technology in a device to replace an oxygen tank.) Hydrogen fuel cells could also store electricity from power plants or store energy in houses.

Fuel cells can store more energy than batteries, and avoid some of their environmental challenges. “Hydrogen potentially is the next generation of power for energy devices because the energy density is actually higher than batteries,” says Dai. “Meaning that when you refuel, you can drive for a longer distance. Or you can power heavier devices.” For the hydrogen economy to come to fruition, there will be engineering and infrastructure challenges to solve. But the ocean could potentially provide the fuel itself.