Changes in gasoline and diesel prices mirror changes in crude oil prices. Those changes are determined in the global crude oil market by the worldwide demand for and supply of crude oil. Per-barrel costs for crude oil – the No. 1 factor in the cost of producing gasoline and diesel – have risen due to a tighter global oil supply/demand balance and lower inventories compared to last year.
With a strong economy, U.S. petroleum demand has run at its highest levels since 2007 and was up by more than 750 thousand barrels per day in April, compared with one year ago. As they do every year around Memorial Day, the start of the summer driving season, Americans are traveling more, which could raise demand further. Although gasoline prices have increased recently, they’re still lower than where they were four years ago, largely because of increased domestic oil production. What Consumers are Paying at the Pump:

The biggest single component of retail gasoline prices is the cost of the raw material used to produce the gasoline – crude oil. Recently, that price has been between $60 and $70 a barrel, depending on the type of crude oil purchased. With crude oil at these prices a standard 42 gallon barrel translates to $1.43 to $1.66 a gallon at the pump. Excise taxes add another 49 cents a gallon on average nationwide.

So the price for gasoline is already at $1.43 or more per gallon even before adding the cost of refining, transporting, and selling the gasoline at retail outlets. Crude oil costs account for about 57 percent of what people are paying at the pump. Excise taxes average 18 percent. That leaves just 25 percent for the refiners, distributors, and retailers.

The federal gasoline tax is 18.4 cents per gallon, and state gasoline fees and taxes range from a low of about 9 cents per gallon in Alaska to as much as 46.7 cents per gallon in California and 49.4 cents per gallon in Washington state. On average, taxes currently make up 18 percent of what consumer are paying at the pump.
The remaining 25 percent of the price is the cost to refine, transport and sell gasoline. If that seems rich, consider that in Q1 2018 the natural gas and oil industry as a whole earned net income of just 6.2 cents per dollar of sales. For manufacturing industries in general, the average over the past decade was under 8 cents per dollar of sales, so natural gas and oil actually have lagged other industries despite recent price increases.