Fuel Cost Calculator Widget

Add a fuel cost calculator to your website. Travellers enter the trip distance, their car's fuel economy in L/100 km, km/L or MPG, and the pump price per litre or gallon, and see the fuel used, the total cost and each passenger's share.

Travel & Auto Calculator Runs in your browser Free · no ads

Customize your widget

Theme
Auto follows the visitor's light/dark setting.
Style
Attribution on your page
Optional and entirely your choice. The exact line is shown in the code below; it links to the tool with rel="nofollow".
More options
Starting values
Leave blank to use the widget's defaults. Visitors can still change every value.

Live preview

Exactly what your visitors will see

Embed code

<iframe src="https://a2z.tools/embed/w/fuel-cost-calculator" title="Fuel Cost Calculator by A2Z Tools" width="100%" height="690" style="border:0;width:100%" loading="lazy" allow="clipboard-write"></iframe>

A plain iframe. Works everywhere, including site builders that strip scripts. Adjust height if your content needs more room.

Works with

How it works

The widget uses the formula of the A2Z Fuel Cost Calculator (fuel = distance / economy, cost = fuel x price) and handles the unit mixes people actually have: distance in km or miles, economy in any of four units and a price per litre, US gallon or UK gallon. Everything is converted through litres per 100 km with the legal unit definitions - the international mile of 1.609344 km and the US gallon of 3.785411784 L listed by NIST, and the imperial gallon of 4.54609 L fixed by the UK Weights and Measures Act 1985 - so a UK driver can use miles, MPG (UK) and a price per litre together. A round-trip switch doubles the distance, the cost can be split between passengers, and the cost per km or mile is shown for comparing cars.

Calculation method

  • L/100 km = 100 / (km per L) = 235.2146 / MPG (US) = 282.4809 / MPG (UK)
  • Litres = distance in km x L/100 km / 100 (1 mile = 1.609344 km); round trip doubles the distance
  • Fuel in the price unit = litres / 1 (litre), 3.785411784 (US gal) or 4.54609 (UK gal)
  • Cost = fuel x price; per person = cost / passengers; money to 2 decimals, cost per km or mile to 3

Worked examples

European road trip

Inputs: 500 km, 7 L/100 km, 1.75 EUR per litre

Result: 35 L of fuel, 61.25 EUR, 0.123 EUR per km

500 x 7 / 100 = 35 L; 35 x 1.75 = 61.25.

US round trip shared by four

Inputs: 300 miles each way, round trip, 30 MPG (US), 3.50 USD per US gallon, 4 people

Result: 20 US gal (75.7 L), 70.00 USD in total, 17.50 USD each

600 / 30 = 20 gal; 20 x 3.50 = 70.

Limitations

  • Uses one average economy figure; hills, speed, cold starts, towing and traffic change real consumption.
  • Fuel only - no tolls, parking, wear or depreciation.
  • The pump price is the visitor's entry; the widget does not look up fuel prices.

Where publishers use it

  • Road-trip and travel blogs estimating the cost of a route
  • Car-sharing and carpool pages splitting fuel between riders
  • Car reviews comparing the running cost of two models
  • Driving-school and fleet websites

Questions

Which fuel economy unit should I pick?

Whatever your car or its review quotes: L/100 km in Europe and Australia, km/L in India and Japan, MPG (US) in the USA and MPG (UK) in Britain. The widget converts between them exactly.

Why are US and UK MPG different?

A UK (imperial) gallon is 4.54609 litres and a US gallon 3.785411784 litres, so the same car shows about 20% more miles per gallon in UK figures.

Does it include tolls or parking?

No, fuel only. Real consumption also rises with speed, heavy loads, traffic and air-conditioning.

Can I set the currency and units?

Yes. The builder sets the currency and metric or imperial units; visitors can switch units in the widget.

Sources

  1. NIST Guide to the SI, Appendix B.8 - conversion factors - National Institute of Standards and Technology (SP 811) . International mile = 1,609.344 m; US gallon (231 in^3) = 3.785411784 L
  2. Weights and Measures Act 1985, Schedule 1 - UK legislation (legislation.gov.uk) . Gallon = 4.54609 cubic decimetres

Cite or recommend this tool

If you reference this tool in an article, course or documentation, these formats are ready to copy. They are optional - nothing is added to your site unless you paste it.

A2Z Tools Fuel Cost Calculator
https://a2z.tools/fuel-cost-calculator

Preview