The knock on electric cars has always been the same: They’re great for the environment, but they’re pokey and impractical, and nobody wants to buy one. The stunning success story of the Tesla Model S has, improbably, flipped that equation. It’s blazingly fast, surprisingly practical, and everyone wants to buy one. But now some critics are asking: How green is it, really?

Reader support makes our work possible. Donate today to keep our site free. All donations DOUBLED!

The quick answer: If current trends hold, it could be pretty darn green in the long run. But as of today, the calculation isn’t as straightforward as you might think. Depending on whom you ask, what assumptions you make, and how you quantify environmental impact, the answer could range from “greener than a Prius” to “as dirty as an SUV.” And where the Tesla falls on that spectrum depends to a surprising extent on where you live and how much you drive it.

Electric cars are squeaky clean, of course, in the sense that they don’t burn gas. With no engine, no gas tank, and no exhaust, they’re considered to be zero-emissions vehicles. But there’s more to a vehicle’s environmental impact than what comes out of the tailpipe. The Tesla doesn’t run on air. It runs on electricity, which in turn is generated from a range of different sources, from nuclear fission to natural gas to the darkest, dirtiest fossil fuel of them all: coal.

Grist thanks its sponsors. Become one.

So if you’re going to stack a Tesla’s per-mile emissions against those of a gas-powered vehicle, you’ll need to start by looking at the composition of the electrical grid. Nationally, the grid is roughly 40 percent coal, 25 percent natural gas, 20 percent nuclear power, and about 10 percent renewable sources, led by hydroelectricity. So it’s fair to say that your average Tesla is powered in large part by burning fossil fuels.

Tesla acknowledges this, and insists that its cars are still far cleaner than their internal-combustion competitors. That’s because battery-powered cars are more efficient at converting their stored energy into forward progress. A Model S can travel upwards of 265 miles on a single charge of its 85 kilowatt-hour battery, which equates to less than three gallons of gas. Its official EPA miles-per-gallon equivalent is 89, far greater than a standard Toyota Prius.

For any given Model S, though, the emissions-per-mile depend heavily on the mix of energy sources that go into your local grid. According to Tesla’s own emissions calculator, if you’re driving your Model S in West Virginia — where the power mix is 96 percent coal — you’re spewing some 27 pounds of CO2 in a typical 40-mile day, which is comparable to the amount you’d emit in a conventional Honda Accord. Indiana, Kentucky, and Ohio aren’t much better. On the other hand, if you’re charging your Tesla in California, where natural gas supplies more than half the electricity — or, better yet, Idaho or Washington, where hydroelectricity reigns — your per-mile emissions are a fraction of that amount. Congratulations: Your Model S is a clean machine after all.

Or is it? In May, a market analyst named Nathan Weiss prompted spit-takes throughout the clean-energy world in May with an incendiary post on the financial news site Seeking Alpha. The headline: “Is the Tesla Model S Green?” Weiss’ answer: a resounding, math-heavy, 6,500-word “No.” In fact, Weiss argued, the Model S is in many ways dirtier than a Jeep Grand Cherokee — and nearly as dirty as a Ford Expedition, one of the largest SUVs on the market. That’s an extreme position, and large swaths of Weiss’ argument were readily rebutted by electric-car advocates. Facing a barrage of criticism, Weiss soon revised his calculations, but still insisted that the Model S’s effective CO2 emissions exceeded those of a smaller SUV like the Toyota Highlander.

Grist thanks its sponsors. Become one.

Weiss’ post was followed in late June by a report in IEEE Spectrum from Ozzie Zehner, a one-time electric-car enthusiast turned outspoken critic. His report, titled “Unclean at Any Speed,” cites studies that find electric cars are no cleaner — and in some cases less clean — than gas-powered cars.

How could that be? Critics point to three main factors that make a Tesla dirtier than the EPA’s ratings, or the company’s own data, would suggest. First, coal-burning power plants emit not just CO2 but also other noxious gases like nitrogen oxides and sulfur dioxide — and in far greater quantities than gas-powered cars. “If a smog-testing center could measure the effective emissions of a Tesla Model S through a tailpipe,” Weiss wrote, “the owner would face fines, penalties, or the sale of the vehicle under state ‘clunker buyback’ programs.” (This problem isn’t Tesla’s fault, obviously, and it would vanish with a cleaner energy grid.)

Second, electric vehicles are more environmentally destructive to manufacture, starting with the energy required to produce their lithium-ion batteries. Those battery packs today are big, bulky, and extremely expensive to manufacture — especially Tesla’s, which is larger and more powerful than that of its competitors. And many electric-vehicle batteries contain rare-earth minerals that are hard to come by and costly to extract. The Tesla’s AC induction motors don’t use rare-earth magnets, but even the company’s engineers would admit that the Model S takes more energy to produce than, say, a Toyota Camry. The question is how long it takes to close that initial gap once you start driving your zero-emissions Tesla. The more you drive it, the greener it becomes.

That leads to the third main argument against the Model S: that it hogs more power than advertised. Weiss reckons that the Model S’s energy-efficiency is dragged down heavily by “vampire load,” or the power that drains from the battery while the car is not in use. Those idle losses played a starring role in John Broder’s famous New York Times piece about running out of juice on a Tesla test drive. Otherwise satisfied owners complain that their cars lose battery range just sitting in the garage.

Vampire load plays a significant role in Weiss’ calculations. In August, though, Tesla delivered on its promise to address the issue in a firmware upgrade. CleanTechnica put the reduction in idle losses at 50 to 70 percent, but Tesla will not confirm the amount. A bigger blow to Weiss’ “dirty as an SUV” argument: as Green Car Reports’ David Noland pointed out in a thorough response, Weiss took into account the carbon footprint of the Tesla’s fuel source, but ignored the carbon footprint of gasoline production. Weiss also assumed, probably erroneously, that people drive the Model S far fewer miles each year than they do the average gas-powered car. Still, Noland agreed that Tesla’s power-consumption estimates may be on the optimistic side. Rejecting the Toyota Highlander comparison, he puts the Model S’s emissions closer to those of the Lilliputian Scion iQ. Not bad for a 4,600-pound luxury sedan.

It’s true, meanwhile, that several studies have cast doubt on the overall environmental benefits of electric cars, including a 2010 report from the National Academy of Sciences. That report is indeed sobering — but less so when you consider that the nation’s electrical grid is already cleaner today than it was at the time of the report. And as a bevy of IEEE officials were quick to point out, Zehner’s “Unclean at Any Speed” (which relied on the NAS report) glosses over a larger body of peer-reviewed research that finds electric cars are cleaner than internal-combustion cars even in coal-heavy states. Still, Zehner is right to say that these studies, including one by the Union of Concerned Scientists in 2012, tend to give short shrift to the full life-cycle impacts of electric cars.

But there’s a reason scientists aren’t scrambling to write papers evaluating the precise present-day tradeoffs between electric cars and their internal-combustion counterparts. The present is short, and the future is long. Environmental trade-offs are changing all the time, mostly in electric cars’ favor. Natural gas has already reduced coal’s share of the national energy mix in recent years. And the new power added to the U.S. grid each year is skewed much more heavily toward renewables than the current mix. If that trend holds, the Model S and other electric cars will only get cleaner. Besides, a lot of electric-car owners are already investing in solar power to charge their vehicles. Meanwhile, Tesla, Nissan, and other automakers are working feverishly to increase the efficiency and reduce the cost of batteries. The technology isn’t advancing exponentially, as it has with computer processors, but it is advancing.

To use the nation’s reliance on dirty coal as an argument against electric cars is to get things backward. Rather, the prospect of making cars far greener than they are today should count as yet another argument against the nation’s continued reliance on dirty coal.

This story first appeared on Slate as part of the Climate Desk collaboration.