Electricity as currently generated in the U.S. is made at an average 30% thermal efficiency. Power transmission via the grid is at 90% efficiency. Charging a battery is 80% efficient. Electric motors are about 90% efficient. My math says that results in 19.44% efficiency, when you look at generation to turning wheels. 20% is a best--real-world case for a gasoline-engine car, some run at more like 15% efficiency. Diesels tend to run at around 25-30% efficiency (some diesel ships run at 45%), and the Toyota Prius runs at about 35% efficiency.
Of course, the calculation of efficiency for cars omits the energy used in extracting, transporting, and refining the gasoline--just as the calculation for electricity omits extracting and transporting the coal.
This calculation leaves out a couple other environmental factors--if you look at only thermal efficiency, that doesn't mean anything unless the weight and coefficient of drag are also equal. A more aerodynamic, lighter car will get better fuel economy (and thus less CO2 emissions) than a heavier one. Electric cars tend to be far heavier than gasoline-engine cars, due to the weight of the battery pack.
Also, some have criticized the environmental impact of manufacturing batteries.
All this is not to say that electric cars are worse--just that they are approximately comparable to gasoline-engine cars based on current power generation and distribution. Electricity can be generated directly from the sun, by geothermal, by hydroelectric, by nuclear, or from the wind--and none of these generate carbon emissions. Also, the newer fossil fuel electric generators can run at 60% thermal efficiency--in other words, they can generate the same electricity on half the coal and half the carbon emissions. When the old, inefficient design electric power generators are phased out, electric cars will be much less polluting than they are today.
Source(s):
For current electric grid efficiencies, Department of Energy.