Petrol Expense Calculator
Petrol Expense Calculator

What Is the Petrol Cost Formula?

One formula drives every petrol calculator: distance divided by mileage, multiplied by price. How to apply it, rearrange it, and convert any efficiency unit.

Every petrol calculator on this site runs the same three-input formula. Distance, mileage, and price go in; fuel volume and total cost come out. The arithmetic is easy. Most wrong answers come from mismatched units, or from a mileage figure copied off a window sticker rather than measured. This guide covers the formula, its rearrangements, the unit conversions, and where the result stops being reliable.

The formula in one line

Calculator, graph paper, ruler, and model car arranged for a fuel-cost calculation
Keep distance, fuel efficiency, and price separate until their units match, then calculate the fuel cost.

Petrol cost = (Distance ÷ Mileage) × Price

Two moves. Divide distance by mileage to get the volume of fuel the journey uses, then multiply that volume by the price of one litre or gallon. A 240 km drive at 12 km/L burns 20 litres; at a price of P per litre it costs 20 × P.

The division is the part people skip: it turns a distance and a rate into a quantity of fuel, and that quantity is what the price multiplies.

The three inputs and the units they must share

Distance is the ground distance of the journey, entered once in full. Mileage is a rate: distance covered per unit of fuel, as km/L or MPG. It is not a total or a tank size. Price is the cost of one unit of fuel, in whatever currency you typed.

A rate, not a total

Mileage describes how far the vehicle goes on one unit of fuel; distance is how far you are going. Those belong on opposite sides of the division sign. Entering litres-per-tank instead returns a plausible but badly wrong cost.

The three inputs must all describe the same fuel and distance system. Valid combinations:

  • Kilometres with km/L and a price per litre.
  • Kilometres with L/100 km and a price per litre.
  • Miles with US MPG and a price per US gallon.
  • Miles with Imperial MPG and an Imperial gallon price.

Anything else needs one conversion first; miles with km/L will not work.

Rearranging the formula for distance, mileage, or price

The same equation solves for whichever value is missing. Start from C = (D ÷ M) × P.

  • Distance: D = (C ÷ P) × M, from a fuel budget and an unknown journey.
  • Mileage: M = (D × P) ÷ C, from a receipt total and a trip distance.
  • Price: P = C ÷ (D ÷ M), from a spend, a distance, and a known mileage.

Each version assumes one mileage for the whole trip and a single price. If a 300 km trip cost C in fuel at a price of P per litre, the litres used are C ÷ P, and 300 divided by that is a working km/L. It describes the trip, not the vehicle, so use it to sanity-check a claimed figure against your own receipts.

Converting between efficiency units

Road-distance markers and different fuel-volume containers representing unit conversion
Kilometres, miles, litres, US gallons, and Imperial gallons must be converted with the correct factors.

Mileage is written four ways, and the formula needs one. Convert to the unit that matches your distance.

  • L/100 km to km/L: divide 100 by the L/100 km figure. 8 L/100 km is 12.5 km/L.
  • km/L to L/100 km: divide 100 by the figure. 12.5 km/L is 8 L/100 km.
  • US MPG to km/L: multiply by 0.425144. 32 US MPG is 13.6 km/L.
  • Imperial MPG to km/L: multiply by 0.354006. 50 Imperial MPG is 17.7 km/L.
  • Reverse both MPG conversions by dividing instead of multiplying.

The trap is direction: with km/L and MPG a bigger number is better, and with L/100 km a smaller number is better. Read 6 L/100 km as 6 km/L and you understate the car and overstate the cost.

Working in miles and gallons

Miles are unambiguous: one mile is 1.609344 km. Gallons are not. A US gallon is 3.785411784 litres and an Imperial gallon is 4.54609 litres, about 20% larger. That is why the same car can read about 40 MPG on a US sticker and near 48 in a UK brochure.

Match the gallon to the price. A US pump posts currency per US gallon, so pair US MPG with a per-US-gallon price. A UK forecourt posts a price per litre, so convert to km/L and price per litre rather than mixing an Imperial MPG figure with a per-litre price. Worked out: 200 miles at 32 US MPG uses 6.25 US gallons, so at P per US gallon the trip costs 6.25 × P. Read the 32 as Imperial MPG instead and the formula reads about 11.3 km/L, not 13.6, so the cost lands roughly a fifth high.

Return trips, repeated journeys, and cost sharing

Four travellers planning a shared road trip beside a car
Calculate the full journey first, then multiply repeated trips or divide a shared total among travellers.

A return trip is two copies of the same distance, so double it up front, or use the round-trip option. Repeated journeys work the same way: a five-day commute is the daily cost times five. Where efficiency is not constant, cost the legs separately and add them.

To share the cost, divide the total by the number of people in the vehicle, driver included. That is an equal split and it assumes everyone uses the trip equally. Where a passenger joins for one leg, cost each segment separately and divide it among whoever was aboard. The trip petrol calculator handles a journey end to end; the carpool split calculator covers the equal-split case.

Common mistakes

  • Mixing units. MPG mileage with a kilometres distance, or an Imperial MPG figure with a per-litre price.
  • Treating a rated figure as measured. The gap between a brochure number and real driving widens on short trips and in cold weather.
  • Forgetting the second leg. A 15 km commute is 30 km a day, and over a month that adds up.
  • Reading L/100 km as km/L. Consumption and distance-per-fuel move in opposite directions.
  • Pricing a US gallon as if it were Imperial. The two differ by about 20%.
  • Keeping an old price. A figure from a few weeks ago is a guess, not an input.

Two of these produce answers that look reasonable, so they are worth a second check. Mixing MPG with kilometres shifts the distance by about 1.6. Pricing the wrong gallon shifts the cost by about 1.2. Neither error announces itself.

What the formula cannot tell you

The formula is exact arithmetic on whatever you give it, and it has no opinion about whether the inputs are good. Everything rests on the values you enter.

The output is only as good as its weakest input. Mileage from a single fill-up or a manufacturer's claim is an estimate; several full-tank records are closer to measured. A price you noted today is a real observation, one you remember from last month is not. Traffic, hills, load, air-conditioning, tyre pressure, cold starts, idling, and driving style are all outside the formula, which also assumes one price for the whole journey.

Treat a single result as a planning estimate, not an accounting record. For a figure you can defend, use your own fill-up data and a price you can point to on a receipt. The steps are in the guide on how to calculate petrol expense, and the petrol expense calculator applies the formula to any vehicle.

Methodology and review

The formula here is the site formula: petrol cost = (distance ÷ mileage) × price. We use 1 mile = 1.609344 km, 1 US gallon = 3.785411784 L, and 1 Imperial gallon = 4.54609 L. US MPG converts to km/L by multiplying by 0.425144, and Imperial MPG by 0.354006. The assumptions are a single mileage figure, one constant price per unit, no currency conversion, and no fuel reserve. Those conversions are set out on the methodology page.

Published 18 September 2026. Reviewed 18 September 2026 by the Petrol Expense Calculator editorial team.

FAQ

Formula FAQs

Common questions about applying and rearranging the petrol cost formula.