Everyone’s saying it: The future of driving is electric. The big-name car companies have plans to start giving Tesla some tough competition. Jaguar’s I-Pace electric SUV will be on sale soon, and Porsche is teasing a new concept Mission E Cross Turismo, which looks like an SUV’d Panamera (in a good way). And normal cars for regular people are going the same way. Combined, Ford and GM plan to offer 34 full electric models in the next five years.

Add to that cities or even whole countries talking about banning sales of cars powered by internal combustion engines: Norway (by 2025), India (by 2030), France and the UK (2040). China, the world’s largest car market, has considered the idea, and in the meantime has imposed some of the planet's most stringent environmental standards.

All this change comes in the name of environmental protection, eliminating the pollutants that make cities gross and unhealthy and the CO 2 that contributes to global climate change. Instead, have the people drive battery-powered electric cars, the sort without exhaust pipes and that run emissions free. But the electricity to charge the things has to come from somewhere. And if that place starts with burning coal, for example, then how green is your electric car, really?

The Union of Concerned Scientists has just crunched the latest numbers to find the answer. The results depend on where in the US you live and drive, but in general battery boosters can breathe easy.

“For the US overall, an electric vehicle is much cleaner than a gasoline vehicle, even when you take into account the emissions from natural gas, coal, or however else you’re generating the electricity,” says Dave Reichmuth, a senior engineer in the nonprofit's clean vehicles program. And as the electric grid moves away from dirty fuel sources, the gap is widening. The UCS study looks beyond driving-related emissions to consider the entire supply chain that goes into making cars go. For the gas guys, that means all the emissions associated with extracting crude oil are included. For electrics, the UCS uses power plant emissions data from the EPA, and includes the environmental cost of mining coal, for example. Because different chunks of the country make power in different ways, the results vary by region.

To put everything on the same scale, the researchers turned their calculations into a familiar format: miles per gallon. An electric car driver in renewable-happy California is doing as much damage to the environment as a gas car that gets 109 miles per gallon. In Texas, that number drops to 60 mpg. In the center of the country, around Illinois and Missouri, it’s just 39 mpg. Nationwide, under this system, electric cars produce the same emissions as cars that get 80 mpg—making them several times cleaner than the average economy of regular cars, which hovers around 28 mpg.