The taxes on a gallon of gas start as soon as the oil comes out of the well. Although negotiated contracts, sweetheart deals, kickbacks and cross-cutting legislative actions can dramatically muddy the waters when it comes to assessing an "average" royalty in many countries, the fact is that companies like Exxon Mobil (NYSE: XOM - News) and BP (NYSE: BP - News) owe the landowner and/or the state money whenever they remove oil and natural gas. In the United States for instance, companies pay a royalty of 12.5% on oil taken from onshore Federal lands, and that is an addition to so-called "bonus bids" that are paid upfront.
If that oil travels through a pipeline to reach a refinery (and much of it does), there's more taxation there - states and municipalities will charge property tax on the pipelines, and some also charge tax based on the volume of oil or gas sent through the pipeline. What's more, pipeline tariffs are often restricted by law, which is in effect a tax as well.
Once the oil gets to the refinery, there's still more taxation that figures into the final pump price. Although excise tax is collected at different times and at different levels, the federal tax on gasoline amounts to a little over $0.18 per gallon, with states tacking on more tax (ranging from $0.07 to $0.30 per gallon depending upon the state). Don't forget, too, that many states tack on their regular sales tax every time you buy gasoline.
As the infomercials say, "but wait, there's more!" From the wellhead to the filling station, employers have to pay taxes on their employees' wages, property taxes on facilities, corporate income taxes and other incidental taxes like vehicle registration. While some of this does not necessarily pass on to the consumer (many economists have demonstrated the employees pay for their employer's taxes in the form of lower wages), most of it does.