How to use the gas mileage calculator
- Enter the distance you drove and select miles or kilometers.
- Enter the fuel used and choose US gallons, UK gallons, or liters.
- The gas mileage calculator updates instantly with your MPG, km/L, and L/100km.
How fuel economy is calculated
The core formula for miles per gallon is straightforward: divide the distance traveled in miles by the volume of fuel consumed in US gallons. For example, if you drive 300 miles and use 10 US gallons, the math is 300 / 10 = 30 MPG.
To convert that result into liters per 100 km, multiply the US gallons by 3.785411784 to get liters, and multiply the miles by 1.609344 to get kilometers. Then apply the formula (liters / km) * 100. Using the same 300 mile trip: 10 * 3.785411784 = 37.854 L and 300 * 1.609344 = 482.803 km, giving (37.854 / 482.803) * 100 = 7.8405 L/100km.
Kilometers per liter follows the same logic but divides kilometers directly by liters. A higher MPG or km/L means better efficiency, while a lower L/100km means better efficiency.
Common fuel economy reference values
This table shows typical fuel consumption figures converted across all three units. Use it as a quick benchmark when evaluating your own results from the gas mileage calculator.
| Vehicle type | MPG (US) | km/L | L/100km |
|---|---|---|---|
| Compact hybrid | 50 | 21.3 | 4.70 |
| Midsize sedan | 30 | 12.8 | 7.84 |
| Full-size SUV | 18 | 7.65 | 13.1 |
| Pickup truck | 15 | 6.38 | 15.7 |
These are approximate averages. Real-world numbers vary based on driving style, terrain, tire pressure, and vehicle maintenance.
US gallons versus UK gallons
A common source of error when calculating fuel economy is confusing US gallons with UK Imperial gallons. One US gallon equals exactly 3.785411784 liters, while one UK gallon equals exactly 4.54609 liters. That makes the UK gallon about 20 percent larger.
If you fill up in the United Kingdom and enter the volume as US gallons in this gas mileage calculator, your computed MPG will be artificially high because the tool assumes less fuel was used than actually was. Always match the fuel unit dropdown to the country where you purchased the fuel.
Practical uses for tracking mileage
Tracking your fuel economy over time helps you spot mechanical problems early. A sudden drop in MPG might indicate under-inflated tires, a clogged air filter, or a failing oxygen sensor. By recording each fill-up with this tool, you establish a baseline for your specific vehicle.
Road trippers also benefit from knowing their exact fuel consumption rate. Once you have your miles per gallon figure, you can estimate fuel costs for any planned route by multiplying the total trip distance by the current price per gallon divided by your MPG.
Fleet managers use similar calculations to compare vehicles and drivers, identifying which routes or habits waste the most fuel.
Why L/100km is more intuitive for comparisons
Miles per gallon is the standard in the United States, but liters per 100 km is used in most other countries and is often considered a better metric for comparing vehicles. The reason is linearity: L/100km scales directly with fuel cost. If car A uses 5 L/100km and car B uses 10 L/100km, car B costs exactly twice as much to drive the same distance.
With MPG, the relationship is inverse and non-linear. Going from 10 to 20 MPG saves far more fuel over 100 miles than going from 30 to 40 MPG, even though both represent a 10 MPG improvement. This is known as the "MPG illusion." When comparing two cars, converting to L/100km using this gas mileage calculator makes the actual savings immediately clear.
Worked examples
Each result below was produced by the same code the tool runs, so you can check your own numbers against them.
| Example | Input | Result |
|---|---|---|
| Typical US highway trip | Distance: 320; Distance unit: mi; Fuel used: 10; Fuel unit: gal_us | Miles per gallon (US): 32; Kilometers per liter: 13.6046; Liters per 100 km: 7.3505 |
| European metric trip | Distance: 500; Distance unit: km; Fuel used: 40; Fuel unit: l | Miles per gallon (US): 29.4018; Kilometers per liter: 12.5; Liters per 100 km: 8 |
| UK imperial gallons | Distance: 250; Distance unit: mi; Fuel used: 8; Fuel unit: gal_uk | Miles per gallon (US): 26.0211; Kilometers per liter: 11.0627; Liters per 100 km: 9.0394 |
| Short city commute | Distance: 15; Distance unit: km; Fuel used: 1.8; Fuel unit: l | Miles per gallon (US): 19.6012; Kilometers per liter: 8.3333; Liters per 100 km: 12 |
FAQ
What is a good gas mileage number?
For a modern non-hybrid sedan, 30 to 35 MPG (about 7 to 8 L/100km) is considered good. Hybrids routinely achieve 50 MPG or more, while large trucks and SUVs typically range from 15 to 22 MPG.
How do I convert MPG to liters per 100 km?
Divide 235.215 by the US MPG value. For example, 30 MPG equals 235.215 / 30 = 7.84 L/100km. This constant comes from the exact definitions of a mile and a US gallon.
Does this calculator work for diesel vehicles?
Yes. The math is identical regardless of fuel type. Simply enter the distance driven and the volume of diesel consumed in your preferred unit.
Why does my real-world MPG differ from the sticker rating?
Manufacturer ratings come from standardized laboratory tests. Real driving involves traffic, hills, air conditioning use, cold starts, and varying speeds, all of which reduce actual fuel economy compared to the test cycle.
Should I use US gallons or UK gallons?
Use US gallons if you filled up in the United States, and UK (Imperial) gallons if you filled up in the United Kingdom or certain Commonwealth nations. Mixing them up produces incorrect results because a UK gallon is about 20 percent larger.
Can I calculate fuel cost with this tool?
This gas mileage calculator focuses on efficiency metrics like MPG and L/100km. To find your trip cost, take the fuel used and multiply it by the price per gallon or liter at your local station.