# Gas Mileage Calculator

- **URL:** https://codeasystem.com/calculators/everyday/gas-mileage-calculator/
- **Category:** everyday
- **Description:** Measure your car’s real-world MPG from a fill-up, with metric L/100km and cost-per-mile equivalents.
- **Primary output:** Fuel economy: 25 mpg

## Inputs
- Miles driven since last fill-up (name: `miles`, type: number, example: 300)
- Gallons used to refill (name: `gallons`, type: number, example: 12)
- Price per gallon (name: `price`, type: number, prefix: $, example: 3.50)

## Outputs
- Fuel economy: 25 mpg
- Metric equivalent: 9.41 L/100km
- Cost per mile: $0.14/mile
- Cost of the fill-up: $42.00

## Formula / methodology
```
mpg = miles driven ÷ gallons refilled
L/100km = 235.215 ÷ mpg     Cost per mile = price per gallon ÷ mpg
```

Fill the tank, reset the trip odometer, drive normally, then fill again. The miles on the trip meter divided by the gallons the second fill takes is your true fuel economy; no estimates, no dashboard guesswork.

## Assumptions & limitations
- You filled the tank to the same level both times.
- Gallons are what the pump actually dispensed.
- Mixed real-world driving; results vary by route.

## How to use
1. **Fill up and reset**; Top off the tank completely and set your trip odometer to zero.
2. **Drive, then refill**; At your next fill-up, note the trip miles and how many gallons the pump reports.
3. **Compare runs**; Repeat across a few tanks to average out city/highway mix and weather effects.

## Example
Driving 300 miles on 12 gallons works out to exactly 25 mpg; about 9.41 L/100km and 14 cents per mile at $3.50 gas.

Result for these inputs:

```
Fuel economy: 25 mpg
```

## About this calculator
### Why your dash display lies (a little)

Onboard economy readouts tend to flatter the car by a few percent because they estimate rather than measure. The two-fill-up method here is ground truth; the pump counts every gallon.

### Reading L/100km

Most of the world quotes consumption, not economy: liters needed per 100 km. Lower is better there, unlike mpg. The conversion constant between US mpg and L/100km is 235.215.

### Cost per mile changes decisions

Knowing you pay roughly 14¢ in fuel per mile reframes choices: the 20-mile detour costs $2.80 of gas, and the “cheap” cross-town errand adds up fast when repeated weekly.

## FAQs
### Why do my numbers differ from the EPA rating?

EPA figures come from standardized lab cycles. Cold starts, short trips, speed and cargo routinely push real-world economy below the sticker number.

### Does AC really hurt mileage?

At highway speeds yes, slightly; typically a few percent. At low speeds, open windows create comparable drag losses, so use AC for comfort without guilt.

### Is premium fuel worth it?

Only if the manufacturer requires it. Cars designed for regular gain essentially nothing measurable from premium.

## Related calculators
- [Fuel Cost Calculator](https://codeasystem.com/calculators/everyday/fuel-cost-calculator/)
- [Fuel Economy Converter](https://codeasystem.com/calculators/conversion/fuel-economy-converter/)
- [Mileage Reimbursement Calculator](https://codeasystem.com/calculators/everyday/mileage-reimbursement-calculator/)

---
Last updated: 2026-08-23 · Version: 1.0.0 · [HTML version](https://codeasystem.com/calculators/everyday/gas-mileage-calculator/)
