People who own all-electric cars may think they are helping the environment. But a new study finds that if their electrical power comes from coal, their vehicles actually make the air dirtier, worsening global warming.

Ethanol isn’t so green, either.

“It’s kind of hard to beat gasoline” for public and environmental health, said study co-author Julian Marshall, an engineering professor at the University of Minnesota. “A lot of the technologies that we think of as being clean … are not better than gasoline.”

The key is where the source of the electricity all-electric cars. If it comes from coal, the electric cars produce 3.6 times more soot and smog deaths than those powered by gas, because of the pollution made in generating the electricity, according to the study that is published Monday by the Proceedings of the National Academy of Science (PNAS). They also are greater producers of heat-trapping carbon dioxide that worsens global warming, it found.

The study comes out as the International Energy Agency issued a report finding that global demand for coal will “continue marching higher,” breaking the 9-billion-ton level by 2019. China, India and other Asian countries are expected to drive demand, the report said, while the United States and Europe will see declines.

The PNAS study examines environmental costs for cars’ entire life cycle, including where power comes from and the environmental effects of building batteries.

“Unfortunately, when a wire is connected to an electric vehicle at one end and a coal-fired power plant at the other end, the environmental consequences are worse than driving a normal gasoline-powered car,” said Ken Caldeira of the Carnegie Institution for Science, who wasn’t part of the study but praised it.

The states with the highest percentage of electricity coming from coal, according to the Department of Energy, are West Virginia, Wyoming, Ohio, North Dakota, and Illinois.

Still, there’s something to be said for the idea of helping foster a cleaner technology that will be better once it is connected to a cleaner grid, said study co-author Jason Hill, another University of Minnesota engineering professor.

The study finds all-electric vehicles cause 86 percent more deaths from air pollution than do cars powered by regular gasoline. Coal produces 39 percent of the country’s electricity, according to the Department of Energy.

But if the power supply comes from natural gas, the all-electric car produces half as many air pollution health problems as gas-powered cars do. And if the power comes from wind, water or wave energy, it produces about one-quarter of the air pollution deaths.

Hybrids and diesel engines are cleaner than gas, causing fewer air pollution deaths and spewing less heat-trapping gas.

“Each gallon of gasoline you burn in your car causes, on average, about 50 cents in damage to the health of others. If you burn ethanol from corn, it’s about twice that – almost a dollar. If you drive the same distance in a car powered by electricity from coal, it’s about $2. If, however, your electric vehicle uses electricity from wind or solar power, it’s as little as 15 cents,” Hill explained.

But ethanol isn’t, with 80 percent more air pollution mortality, according to the study.

“If we’re using ethanol for environmental benefits, for air quality and climate change, we’re going down the wrong path,” Hill said.