Skip to main content

Gas Mileage Calculator

Determine fuel efficiency in MPG, km/L, or L/100km from distance traveled and fuel consumed. An optional cost-per-unit breakdown shows total fuel cost and price per mile or kilometer. Fraction and mixed-number inputs are accepted alongside decimals, and a step-by-step formula view expands each calculation so the underlying arithmetic is visible.

Runs entirely in your browser

This tool sends nothing over the network. Everything you enter is processed on your device and never reaches our servers.

Automotive
Fuel Economy
Travel Cost
Loading the tool
Reference

Documentation

A gas mileage calculator turns the distance driven and the fuel consumed into a fuel efficiency figure, miles per gallon (MPG), kilometers per liter (km/L), or liters per 100 kilometers (L/100km), depending on the units used. An optional fuel price adds a cost-per-distance-unit breakdown and a total fuel cost for the trip.

  • Distance driven accepts whole numbers, decimals, fractions (3/4), and mixed numbers (175 1/2), in either miles or kilometers.
  • Fuel used accepts fractions or decimals, in gallons or liters, so a partial fill-up can be entered exactly as pumped.
  • An optional fuel price per unit adds the cost breakdown; dollar signs and commas are stripped automatically.
  • Settings can show the step-by-step substitution and arithmetic behind each result, and can add the metric L/100km figure alongside the primary efficiency result.
  • The formula for miles per gallon is: MPG = Distance / Fuel Used. For kilometers per liter: km/L = Distance / Fuel Used. For liters per 100 km: L/100km = (Fuel Used / Distance) x 100.

A 250-mile trip that used 10 gallons of fuel computes to 250 / 10 = 25 MPG. At $3.00 a gallon, total fuel cost is 10 x 3.00 = $30.00, or 30.00 / 250 = $0.12 per mile.

Fuel efficiency tracking serves drivers, fleet managers, and travelers who need accurate per-trip or per-vehicle consumption data. Below are scenarios where the results provide direct value.

  • Daily commuting: Record odometer readings and fuel fill-ups each week to monitor whether driving habits, tire pressure changes, or seasonal fuel blends affect MPG over time.
  • Road trip planning: Enter a planned route distance and the vehicle's known fuel consumption rate to estimate total gallons or liters needed and the expected fuel cost before departure.
  • Fleet management: Compare fuel efficiency across multiple vehicles in a commercial fleet by logging distance and fuel for each truck or van after every refueling stop.
  • Vehicle comparison: Test two vehicles over identical routes and compare the resulting MPG or km/L figures to inform a purchase or lease decision with real-world data rather than manufacturer estimates.
  • Maintenance diagnostics: A sudden drop in fuel efficiency often signals mechanical issues such as clogged air filters, underinflated tires, or failing oxygen sensors. Tracking MPG trip by trip highlights these changes early.
  • Rental car evaluation: Log the distance driven and fuel purchased during a rental period to verify the actual efficiency against the rental agency's stated fuel economy class. Compare results across multiple rental trips to identify which vehicle categories deliver the most value.
  • Budget forecasting: Multiply the cost per mile or cost per kilometer by projected monthly driving distance to estimate the fuel line item in a household or business budget. Adjust the fuel price input to model different price scenarios and plan for seasonal fluctuations in fuel costs.
  • Driving habit optimization: Record mileage before and after adopting fuel-saving techniques such as steady cruising speeds, reduced idling, or lighter cargo loads. Quantify the improvement in MPG or km/L to validate which habits produce measurable savings at the pump.
  • Hybrid and electric comparison: Enter fuel consumption data from a conventional vehicle alongside equivalent trips in a hybrid to produce side-by-side efficiency figures. Pair the cost-per-mile output with electricity rate data to build a complete operating cost comparison between powertrains.
Inputs, outputs, and what the Gas Mileage Calculator computes

What the Gas Mileage Calculator asks for and what it returns, as a plain list. Defaults, units, and ranges are the ones the form loads with.

Inputs

  • Distance Driven (text input)
  • Distance Unit · default: Miles
  • Fuel Used (text input)
  • Fuel Unit · default: Gallons
  • Fuel Price per Unit (optional) (text input)
  • Show step-by-step formula · default: off
  • Show L/100km (metric efficiency) · default: off

Controls

Calculate · Reset

Example

A 250-mile trip that used 10 gallons of fuel computes to 250 / 10 = 25 MPG.