The carbon from the gasoline mixes with oxygen from the air. Gasoline consists mostly of hydrocarbons—chains of carbon encircled by atoms of hydrogen. When the hydrocarbons burn, they break apart and recombine with the air. This reaction produces heat, as well as two chemical byproducts: water and carbon dioxide.

For example, consider a single molecule of octane—a typical hydrocarbon that you'd find in gasoline. Octane consists of eight atoms of carbon and 18 atoms of hydrogen, written as C8H18. If you break down the octane and mix it with enough oxygen (O2), you've got the ingredients—i.e., the atoms of carbon, hydrogen, and oxygen—to make eight molecules of carbon dioxide (CO2) and nine molecules of water (H2O). The eight molecules of CO2 weigh about three times more than the one molecule of octane you started with. That doesn't mean you've violated the law of conservation of mass; instead, you've added the weight of the oxygen from the air to the weight of the carbon from the gasoline. (For a more in-depth discussion of this reaction, click here.)

This reaction gives only a general sense of what happens when you burn a gallon of gas. First, the combustion that occurs in a car engine doesn't work perfectly, which means not every hydrocarbon gets converted into carbon dioxide and water vapor. Sometimes there's not enough oxygen available to complete the reaction, in which case hydrocarbons can be converted into poisonous carbon monoxide (CO). Burning gasoline can also release nitrous oxide and other gases.

Second, gasoline consists of octane along with many other kinds of hydrocarbons. You'll also find additives like surfactants, freezing-point depressants, corrosion inhibitors, and dyes. These nonhydrocarbon additives might make up half a percent of the total composition of the gasoline. There are also differences between winter and summer blends, low- and high-octane, and leaded and unleaded.

Thus, any estimate of the amount of carbon dioxide that comes from a gallon of gas must be based on some assumptions. The Environmental Protection Agency starts with a guess for how many grams of carbon are in each gallon of gas. First, they determine how much carbon is in each particular kind of gasoline, and then they come up with a weighted average based on consumption levels for each variety. Using this method, they estimate that a gallon of gas contains, on average, 2,421 grams of carbon. That's enough to make 8,877 grams of CO2. They multiply that number by 0.99 to account for the carbon that doesn't react fully with the oxygen. Their result: 8,788 grams, or about 19.4 pounds. (The Energy Information Administration gives a slightly higher number—19.564.)