ToolSphere

Gas Mileage Calculator

Student tools

Calculate US MPG from miles and gallons, compare L/100 km, and estimate fuel cost per mile and trip gas cost using your own price per gallon.

Measured fuel economy

30 MPG (US)

7.84 L/100 km · $0.1200 per mile

Trip fuel cost: $54.00 for 15 US gallons

Use miles and fuel measured over the same interval. The trip estimate assumes the same MPG and gas price throughout. Fuel cost excludes tolls, maintenance and other driving costs. All gallons are US liquid gallons.

On this browser only

Give feedback

Did this tool help?

Tell us what worked, what didn’t, or what you’d like next.

Opens Google Forms in a new tab with this tool’s name filled in. No sign-in or email required. Feedback is optional.

How to use Gas Mileage Calculator

  1. 1Enter miles driven and US gallons consumed over the same interval.
  2. 2Enter your gas price in dollars per US gallon.
  3. 3Enter the complete planned trip distance in miles, including the return if needed.
  4. 4Read MPG, L/100 km, cost per mile and trip fuel cost above the fields.

About Gas Mileage Calculator

Measure MPG and plan a fuel budget

Use this gas mileage calculator to turn a measured driving interval into miles per gallon, then estimate the fuel needed for an upcoming trip. Enter miles driven and US gallons used over the same interval. Add a gas price in dollars per US gallon and the distance of your planned trip. The answer appears first, with MPG, liters per 100 kilometers, fuel cost per mile, and estimated trip fuel cost. A loaded example shows how the fields work before you enter your own measurements.

All gallons on this page are US liquid gallons. Imperial gallons are a different unit and cannot be entered directly. The metric result is shown alongside US MPG so you can compare fuel consumption expressed as L/100 km. For other distance measurements, use the length converter before entering miles. The volume converter can help convert a fuel amount to US gallons.

Measure distance and fuel over the same interval

A useful manual method starts with a filled tank and a recorded odometer or reset trip meter. Drive normally, then refill to a comparable level and record both the distance traveled and the fuel added. The fuel added at that refill approximates the fuel consumed since the first fill, assuming the tank levels are comparable. Use the distance from that same interval. Gallons bought for a different driving period will not produce a meaningful MPG result.

Partial fills and inconsistent stopping points can distort a single-tank estimate. Keep a log if you want to compare several intervals. Add the miles together and add the gallons together, then enter those totals. Do not average the individual MPG readings without considering how much fuel each interval used. A long highway drive and a short city errand need not contribute equally to a combined measurement.

Worked example: a measured tank and a planned trip

The loaded example uses 360 miles driven and 12 US gallons consumed. Running the calculator library gives 30 MPG. The same measurement converts to approximately 7.84 L/100 km. At an entered gas price of $3.60 per US gallon, fuel cost is $0.1200 per mile. A planned 450-mile trip needs an estimated 15 US gallons and costs $54.00 in fuel under those assumptions.

Keep the measured distance, gas price, and planned trip unchanged, but change fuel used to 15 US gallons. The library now gives 24 MPG, approximately 9.80 L/100 km, and $0.1500 per mile. Estimated trip fuel rises to 18.75 US gallons and $67.50. This comparison shows the effect of a different measured consumption rate; it does not predict how a particular car will perform on a future route.

Read MPG and L/100 km correctly

MPG means distance traveled per unit of fuel, so a larger MPG value means less fuel used for the same distance. L/100 km means fuel consumed per fixed distance, so a smaller value means less fuel used. The two measurements move in opposite directions. Compare vehicles or trips using the same unit and comparable operating conditions rather than treating both numbers as scores that should increase.

The conversion uses the unit definitions built into the library: a US liquid gallon equals 3.785411784 liters, and a mile equals 1.609344 kilometers. Liters per 100 kilometers equals gallons times liters per gallon, divided by miles times kilometers per mile, then multiplied by 100. The calculator uses the unrounded result internally. Display rounding does not feed back into the trip estimate.

Follow the fuel-cost formulas

MPG equals miles driven divided by gallons used. Fuel cost per mile equals price per gallon divided by MPG. Estimated trip gallons equal planned miles divided by measured MPG. Estimated trip fuel cost equals those trip gallons multiplied by the entered price. Gas prices can include fractional cents per gallon; they are not restricted to the two decimal places commonly used for dollar totals.

The trip distance is the complete distance you want to budget for. Enter a round trip's full distance if you want both directions included. The calculator does not double it automatically, look up routes, or retrieve live station prices. Fuel already in the tank still has a consumption cost; this estimate describes fuel used on the trip rather than the amount you must purchase before departure.

Understand the estimate's limits

The trip calculation assumes the same MPG and gas price throughout the journey. Traffic, speed, idling, weather, payload, tires, hills, and towing can change consumption. A recent measurement from similar driving conditions is usually more useful for planning than an unrelated interval. Allow separately for changing gas prices and your own contingency budget; no automatic reserve is added here.

Fuel cost per mile excludes maintenance, insurance, depreciation, parking, and tolls. It is not a reimbursement rate or a complete vehicle ownership cost. Miles driven and fuel used must both be positive. A zero trip distance or zero gas price is allowed and produces zero corresponding cost. Blank or invalid entries clear the answer with a correction. Very small nonzero answers use scientific notation when needed to stay visible. For an equal group payment after agreeing on shared expenses, open the tip calculator.

Guides and tutorials

Frequently asked questions

How do I calculate gas mileage?

Divide miles driven by US gallons consumed over the same interval. The result is miles per US gallon.

Are these US or Imperial gallons?

US liquid gallons only. Convert Imperial gallons before using this calculator.

How is L/100 km calculated?

The tool converts measured gallons to liters and measured miles to kilometers, then calculates liters consumed per 100 kilometers.

Is a higher L/100 km better?

No. Lower L/100 km means less fuel used for a given distance. Higher MPG means less fuel used for a given distance.

How is trip fuel cost estimated?

Trip miles divided by measured MPG gives estimated gallons. Multiplying by your entered price per gallon gives fuel cost.

Does the trip distance include the return journey?

Only if you enter it. The tool uses the complete distance you provide and does not double it.

Can I use a gas price with fractional cents?

Yes. Decimal prices per gallon are supported; trip cost is displayed in dollars and cents except very small nonzero results.

Why can’t I enter zero gallons?

MPG requires positive fuel consumption and positive measured miles. Zero price and zero planned trip miles are supported.

Does fuel cost per mile include maintenance?

No. It includes fuel only, excluding maintenance, insurance, depreciation, parking and tolls.

Can I combine several tanks of fuel?

Yes. Add the miles and gallons from matching intervals and enter those totals. Do not simply average individual MPG readings.

Have a suggestion for Gas Mileage Calculator?Share your feedback ↗