Free tool

Gas cost calculator, fuel cost for any trip.

Type the distance, the fuel economy of the car and the price of fuel, and see what the trip costs. Use miles or kilometres, mpg (US), mpg (UK), L/100 km or km/L, and a price per gallon or per litre, in any mix. Make it a round trip, split the cost between people, add tolls and other costs, compare two cars, or turn a weekly distance into a cost for the year. The page claims no price: you type the one at your pump.

Download table (CSV)
Yearly cost and a second car
Uses the unit chosen for Distance. Leave at 0 to skip.

The numbers in the boxes are examples. Type the fuel price you see at the pump.

Worked out in your browser. Nothing is sent anywhere.

The maths

Distance, economy, price.

01 / Fuel used

Distance ÷ economy

150 miles at 30 mpg uses 5 gallons. Every unit is turned into litres and kilometres first, so units can be mixed.

02 / Cost

Fuel × price

5 gallons at 3.50 a gallon is 17.50. Tolls and other costs are added, then split between people.

03 / Over time

Two cars, one year

Compare two cars on the same trip, or turn a weekly distance into a yearly fuel cost.

Guide

How to work out the cost of gas, in miles or kilometres.

A gas cost calculator, also called a fuel cost calculator, multiplies the fuel a trip uses by the price of that fuel. You need three things: how far you are going, how far the car goes on a unit of fuel, and what the fuel costs. This one takes miles or kilometres, the four common ways of stating fuel economy, and a price per gallon or per litre, so you can type the numbers the way you know them. It adds a round trip, a split between people, tolls, a second car and a yearly cost. It claims no price: fuel prices change every day and by place, so you type what you see at the pump.

How to use the calculator

  1. Type the Distance and choose Miles or Kilometres.
  2. Type the Fuel economy of the car and pick its unit: mpg (US), mpg (UK), L/100 km or km/L. The car's manual or the dashboard trip computer shows it.
  3. Type the Fuel price and choose whether it is per US gallon, UK gallon or litre.
  4. Tick Round trip if you are coming back, and type the number of people under Split between. Add Tolls and Other costs for the whole trip, such as parking.
  5. Open Yearly cost and a second car to type a weekly distance or compare Car A with Car B.
  6. Read the cards. Copy result copies a summary, and Copy link to these numbers shares your inputs.

The sums, with an example

Take 150 miles in a car that does 30 mpg, with fuel at 3.50 a US gallon. The car uses 150 ÷ 30 = 5 gallons, which costs 5 × 3.50 = 17.50. That is 0.117 a mile, or 0.072 a kilometre. As a round trip it is 35.00, and split between 3 people it is 11.67 each. Add 12 of tolls and the round trip costs 47.00.

The page turns every unit into litres and kilometres first, so you can mix them. A trip of 400 km in a car that uses 6.5 L/100 km needs 400 × 6.5 ÷ 100 = 26 litres. At 1.65 a litre that is 42.90.

mpg, L/100 km and km/L

Miles per gallon counts distance per fuel, so a bigger number is better. L/100 km counts fuel per distance, so a smaller number is better. The UK gallon is bigger than the US gallon, so the same car has a higher mpg on the UK scale. The page uses these exact values: 1 US gallon is 3.785411784 litres, 1 UK gallon is 4.54609 litres and 1 mile is 1.609344 kilometres. The NIST conversion tables list the UK gallon and the mile as exact, and the US gallon as 3.785 412 litres after rounding (NIST SP 811 Appendix B, checked 18 Oct 2026).

mpgL/100 km if US mpgL/100 km if UK mpg
2011.7614.12
259.4111.30
307.849.42
356.728.07
405.887.06
504.705.65

Pick the right mpg unit. Choosing US mpg for a car whose book gives UK mpg makes the fuel use look about 17% too low. The "same car in every unit" panel under the cards shows all four units at once, so you can check yours.

Comparing two cars, and a year of driving

Tick Compare with a second car and type the economy of Car B. With the same 150 miles and 3.50 a gallon, a 45 mpg car uses 3.33 gallons and costs 11.67, which is 5.83 less than the 30 mpg car. Type 100 miles a week under Distance each week and the year is 5,200 miles: 606.67 for the 30 mpg car and 404.44 for the 45 mpg car, a difference of 202.22. If Car B runs on a different fuel, type its price in the optional box.

What the page leaves out

  • It uses one steady economy figure. Real economy changes with speed, load, hills, weather and traffic.
  • It counts fuel only. Wear, tyres, insurance and parking are not in it unless you type them under Other costs.
  • For an electric car, type the cost per kilometre or mile yourself, as it has no gallons.

More worked examples

In UK units, a trip of 250 miles in a car that does 40 mpg (UK) uses 250 ÷ 40 = 6.25 gallons, which is 6.25 × 4.54609 = 28.41 litres. At 1.45 a litre that is 41.20. If you typed the price per UK gallon instead, 6.59 a gallon gives the same answer, 41.20, because 1.45 × 4.54609 = 6.59.

In km/L, a trip of 300 km in a car that does 12.5 km/L uses 300 ÷ 12.5 = 24 litres, and at 1.65 a litre that is 39.60. The same car is 8 L/100 km, which is 29.4 mpg (US) or 35.3 mpg (UK).

A mixed case: 150 miles at 30 mpg (UK) with the price typed per US gallon at 3.50. The trip needs 5 UK gallons, which is 22.73 litres, and at 3.50 ÷ 3.785411784 = 0.9246 a litre it costs 21.02.

To switch between other units, use the unit converter. To split the bill after a trip, try the tip calculator, and for a percent change in prices the percentage calculator.

Questions

Good to know.

How do I calculate the cost of gas for a trip?

Divide the distance by the miles per gallon to get the gallons, then multiply by the price per gallon. 150 miles at 30 mpg and 3.50 a gallon is 5 gallons and 17.50.

How do I convert mpg to L/100 km?

For US mpg, divide 235.215 by the mpg. For UK mpg, divide 282.481 by the mpg. So 30 mpg (US) is 7.84 L/100 km and 30 mpg (UK) is 9.42 L/100 km.

What is the difference between US and UK mpg?

The gallons differ. A UK gallon is 4.54609 litres and a US gallon is 3.785411784 litres, so a UK mpg figure is about 20% higher for the same car.

Can I mix units, like km with a price per gallon?

Yes. Each box has its own unit and the page turns them all into litres and kilometres first.

How do I split the cost between passengers?

Type the number of people under Split between. The total, including tolls and other costs, is divided equally.

Does it know the price of gas near me?

No. Fuel prices change daily and by place, and the page uses none. Type the price you see.

Can I work out the yearly cost of driving?

Yes. Open Yearly cost and a second car, type the distance you drive in a week and the weeks in a year. The fuel cost for the year appears in the cards.

Is anything sent anywhere?

No. Everything is worked out in your browser, and your last numbers are kept on this device only.