DEV Community

yanan yu
yanan yu

Posted on

Solving the UK's absurd Fuel Math: A privacy-first calculator for road trips πŸš—β›½

If you drive in the UK, you already know we have the most mathematically chaotic, schizophrenic measurement system on the planet.

Think about it:

We measure our journey distance in Miles.

We measure our car's fuel efficiency in Miles Per Gallon (MPG).

But when we pull into a petrol station, we buy fuel in Litres.

And the price on the board is listed in Pence (not Pounds).

Trying to calculate exactly how much a drive to a client's officeβ€”or a road trip to a tech conference with friendsβ€”will cost in actual Pounds (Β£) requires converting Imperial Gallons to Litres (1 UK Gallon = 4.54609 Litres, which is different from a US Gallon, just to make it worse), factoring in the pump price, and dividing by 100.

Doing this in your head, or tapping it out on a phone calculator while sitting at the steering wheel, is a nightmare.

I usually carpool with a few other devs to hackathons or co-working spaces, and splitting the petrol bill is always a hassle. I recently found a brilliant, privacy-first tool that solves this exact problem: the Mini-Tools Fuel Cost & MPG Calculator.

Why this is a top-tier utility for devs πŸ› οΈ
As usual, I popped open the Chrome DevTools before putting in my data. Here is why this tool earned a permanent spot in my bookmarks:

  1. 100% Client-Side Engine (Zero Tracking) When you use navigation apps or mainstream car-portal calculators, they almost always ping a backend server with your journey data to build a profile on your travel habits and vehicle efficiency.

This tool is built on a Zero-Trust architecture. The entire Imperial-to-Metric conversion engine is written in vanilla JavaScript and runs exclusively in your local browser memory. There are zero POST requests. Your travel plans and financial data never leave your phone.

  1. The "Split the Bill" Feature + History API This is the absolute killer feature for group trips. You punch in your distance, MPG, and fuel price, and then you just increase the "Passengers" counter. It instantly divides the total cost and shows exactly how much each person owes.

But the best part? It uses the History API to dynamically update the URL state as you type (e.g., ?dist=200&mpg=45&price=145.9&split=4).

I don't have to explain the math to my mates. I just configure the trip, copy the URL, and drop it into our Slack or WhatsApp group. When they click it, the exact calculation and their split of the bill loads instantly on their screen. No server tracking, just pure, clean URL sharing.

  1. Instant DOM Reactivity Because there is no server round-trip, the UI is blazing fast. You can literally hold down the input keys and watch the total cost and split-cost recalculate at 60fps.

The Bottom Line
If you are commuting, planning a UK road trip, or just want to figure out exactly how much that drive is costing you without feeding your data to an ad network, give this a try.

Check it out here: https://mini-tools.uk/fuel

Does anyone else find the UK's mix of Imperial and Metric completely maddening? How do you usually split travel costs with your team? Let me know in the comments! πŸ‘‡

Top comments (0)