Math & calculatorsFree

Fuel Cost Calculator

Free fuel cost calculator. Estimate trip cost from distance, MPG or L/100km, and fuel price.

Last updated 18 October 2026

One division, and two ways it can quietly give the wrong answer

The arithmetic is trivial. In US units it divides the distance by the miles per gallon to get gallons, then multiplies by the price. In metric it multiplies the distance by the litres per 100 km and divides by 100, then multiplies by the price. Both are correct.

The two problems are at the edges, in the unit switch and in the currency, and both produce a confident number rather than an error. They come first.

Switching units does not convert your numbers

The unit selector changes the labels and the formulas. It does not touch the values you have already typed, and the two scales are nothing like each other, so the answer changes enormously with no warning. Measured, with 250, 28 and 3.50 in the three boxes:

That is nearly eight times the cost, from one dropdown. The reason is that efficiency runs the opposite way in the two systems: a high miles-per-gallon figure is a frugal car, while a high litres-per-100km figure is a thirsty one. 28 MPG is an ordinary car; 28 L/100km is a heavy truck.

Set the unit first, then type the numbers. If you switch afterwards, retype all three. For reference, 28 MPG is about 8.4 L/100km, and the conversion is 235.2 divided by the MPG figure.

The currency is always US dollars, whatever your browser says

The three input labels say only “($)”, and the result is formatted as US dollars regardless of where you are. The number formatting follows your browser's language, which makes the mismatch look deliberate when it is not. Measured, the same trip in four browser locales:

The British result is the clearest illustration. Enter a price in pounds per litre and the page will tell you the answer in US dollars, in so many characters. The arithmetic is still right, because multiplying a price by a quantity does not care what the currency is. Read the result as a number in whatever currency you typed, and ignore the symbol.

What it accepts, and the one rejection that surprises people

Values are read as decimals rather than whole numbers, which makes this tool behave differently from several others on this site. Measured:

Note that letters never reach the calculation at all: the boxes only accept numeric input, so typing 250abc leaves the box empty and produces the same refusal as typing nothing.

The per-mile figure is rounded to the nearest cent, which is coarse

The cost per mile or per kilometre is formatted as currency, so it carries two decimal places and nothing more. Measured, a 250 mile trip at 28 MPG and $3.50 a gallon costs $31.25, which is 12.5 cents a mile, and the page shows $0.13.

At that scale the rounding is a 4% error, and it gets worse for efficient vehicles: anything under half a cent a mile displays as $0.00. The same figure is shown for a one mile trip and a one million mile trip, because it is a rate rather than a total, so the rounding is the only thing that varies.

If you are costing a fleet or comparing two vehicles, divide the total cost by the distance yourself rather than reading the per-mile row. The total is reliable: a million miles at those figures gives $125,000.00 and 35,714.29 gallons, with no overflow or loss of precision at that size.

What this tool deliberately does not do

For the journey time rather than its cost, Hours and Minutes Calculator adds and subtracts durations directly.

Sources

Every behaviour and every value on this page was measured against this tool as it is published, in a browser, on 18 October 2026. The four currency results were taken by loading the page in four different browser language settings.

Frequently asked questions

I switched to metric and the cost jumped eight times. Why?

Because switching units changes the labels and the formulas but leaves your numbers alone, and the two efficiency scales run in opposite directions. Measured, 250 / 28 / 3.50 gives $31.25 read as miles, MPG and dollars per gallon, and $245.00 read as kilometres, litres per 100 km and dollars per litre. Set the unit first, then type. 28 MPG is about 8.4 L/100km.

Can I enter prices in pounds or euros?

Yes, and the arithmetic will be right, but the answer will be labelled in US dollars because the currency is fixed. In a British browser it even reads “US$”. Read the figure as a number in your own currency and ignore the symbol.

Why does the result show a comma for the decimal point?

Because the number is formatted in your browser's language while the currency stays US dollars. A German browser gives “31,25 $”. The value is the same.

Why will it not accept zero miles per gallon?

Because that describes a vehicle that burns fuel without moving, and the division has no meaningful answer. Negative distances, efficiencies and prices are refused for the same reason. A price of zero is accepted, since free fuel is possible, and so is a distance of zero.

Is the cost per mile accurate?

Only to the nearest cent, which is coarse for a per-mile rate. Measured, a trip costing 12.5 cents a mile displays as $0.13, a 4% difference, and anything under half a cent a mile shows as $0.00. For fleet costing, divide the total by the distance yourself.

Will it match what I actually spend?

Only if your efficiency figure is your real one. Manufacturer figures are usually optimistic, and motorway versus town driving, load, terrain, air conditioning and tyre pressure all move real consumption. None of those is an input. Work out your own figure from a few tank fills and use that.

Does it work for an electric car?

No. The inputs are gallons or litres and a price per unit of them. Electric consumption is measured in kilowatt hours per distance and there is no setting for it.

Are my figures sent anywhere?

No. The calculation runs in your browser, nothing is stored between visits, and no distance, vehicle or price leaves your device.

Related tools