Fuel Cost Calculator - Gas Cost for Any Trip or Commute

Trip Details

Calculate the gas cost of a trip from distance, MPG, and fuel price, or work out your gas mileage from a fill-up. See cost per mile and compare vehicles.

Select units

Enter distance

Enter efficiency

Enter fuel price

Real mileage changes with how and where you drive: traffic, terrain, cargo and weight, and driving style all move it. The tool uses the single mileage figure you enter.

Formulas and sources

Each formula this calculator uses, where it comes from, and what it leaves out. "How it works" shows the same formula with your own numbers.

Fuel and cost, US units

In US units

Gallons = Distance ÷ MPG, Cost = Gallons × Price
Gallons
the fuel needed, in US gallons
Distance
the trip distance, in miles
MPG
miles per US gallon
Cost
the fuel cost of the trip
Price
the price of one US gallon

The mileage is the one figure you enter.

Source: Standard formula; no single publisher. Units as NIST defines them [1]; what moves real mileage: fueleconomy.gov [2]; why ratings may not predict it [3].

Fuel and cost, metric units

In metric units

Liters = (Distance ÷ 100) × L/100km, Cost = Liters × Price
Liters
the fuel needed
Distance
the trip distance, in kilometers
L/100km
liters used per 100 kilometers
Cost
the fuel cost of the trip
Price
the price of one liter

Source: Standard formula; no single publisher.

Trip cost with extras

With Trip Extras

Adjusted Distance = Distance × Round trip multiplier; Trip cost = Fuel cost + Tolls + Parking + Other
Distance
the distance you entered
Round trip multiplier
2 for a round trip, 1 for one way

Tolls, parking and other costs are added once per trip, in your currency.

Source: Standard formula; no single publisher.

Per person and per month

Cost per person = Trip cost ÷ Passengers Monthly cost = Trip cost × Trips per month
Passengers
the people sharing the cost
Trips per month
from Trip Extras

Source: Standard formula; no single publisher.

Cost per mile

Cost per mile = Price ÷ MPG, Miles per $1 = MPG ÷ Price Cost per km = (L/100km ÷ 100) × Price, km per $1 = 1 ÷ Cost per km
Price
the price of one US gallon, or one liter
MPG
miles per US gallon
L/100km
liters used per 100 kilometers

Fuel only: a round trip, the extras and the passengers leave it unchanged.

Source: Standard formula; no single publisher.

Fuel efficiency from a fill-up

MPG = Miles ÷ Gallons L/100km = (Liters ÷ km) × 100
Miles
the distance on the trip meter since the last fill-up
Gallons
the US gallons the tank took to fill again
km
the same distance, in kilometers
Liters
the same fuel, in liters

To two decimals. It needs a full tank at both ends, so that the fuel the pump shows is the fuel the distance used. The result goes into Fuel Efficiency only when you press Use.

Source: Standard formula; no single publisher.

Compare Vehicle

With Compare Vehicle

Savings = Trip cost − other vehicle's trip cost
Savings
above zero, the other vehicle is cheaper

The other vehicle runs the same distance and extras through its own efficiency and price; a blank one of the two takes the trip’s own, so two cars at one price need only the other MPG. Below zero, it costs more.

Source: Standard formula; no single publisher.

Switching units

L/100km = 235.215 ÷ MPG
L/100km
liters per 100 kilometers
MPG
miles per US gallon, not the imperial (UK) gallon

A switch converts with 1 mile = 1.609344 km and 1 US gallon = 3.785412 liters. It then rounds the economy to one decimal and the price to three, as a dashboard and a pump show them.

Source: Uses NIST's conversion factors [1].

What fuel efficiency is worth: the Road Trip (Simple) example

What fuel efficiency is worth: the Road Trip (Simple) exampleBars of the fuel cost of a 300 mile trip at efficiencies of 15 mpg to 50 mpg. 15 mpg: $75.00, 20 gal. 20 mpg: $56.25, 15 gal. 25 mpg: $45.00, 12 gal. 30 mpg: $37.50, 10 gal. 40 mpg: $28.13, 7.5 gal. 50 mpg: $22.50, 6 gal.EfficiencyFuel costFuel15 mpg$75.0020 gal20 mpg$56.2515 gal25 mpg$45.0012 gal30 mpg$37.5010 gal40 mpg$28.137.5 gal50 mpg$22.506 gal
300 miles at $3.75 a gallon: the fuel needed is the distance ÷ the efficiency, so each step up saves less. Going from 15 to 20 mpg saves $18.75 on this trip; from 40 to 50 mpg, $5.63. The example's 25 mpg costs $45.00.

Sources

  1. National Institute of Standards and Technology. NIST Guide to the SI, Appendix B.8: Factors for units listed alphabetically, mile per gallon (U.S.), mile and gallon (U.S.). Special Publication 811, 2008 edition.Our automated tests check this calculator against 4 cases from it.
  2. U.S. Department of Energy and U.S. Environmental Protection Agency, fueleconomy.gov. Many Factors Affect Fuel Economy. Undated page, read October 5, 2026.
  3. U.S. Department of Energy and U.S. Environmental Protection Agency, fueleconomy.gov. Your Mileage Will Vary. Undated page, read October 5, 2026.
  4. U.S. Energy Information Administration. U.S. Gasoline and Diesel Retail Prices, weekly, U.S. regular gasoline. Week of October 19, 2026 (released October 20, 2026).

What this calculator does not cover

  • It estimates fuel cost only: no maintenance, insurance, depreciation or financing. The Car Loan Calculator covers financing a vehicle.
  • The EPA's ratings are for comparing vehicles, and fueleconomy.gov says they may not accurately predict the average MPG you get. The tool uses the one figure you enter.
  • It holds no live fuel price; enter the price you pay.

Opening values

A new tab opens at $4.00 a gallon. Regular gasoline averaged $4.28 across the US in the week of October 19, 2026 [4]; prices differ by state and by week.

Sources checked on

How we choose sources and test the calculators: How CalcTrail calculates

Help

Quick Start Guide

  1. Select units: Switch between metric units and US units (miles, US gallons).
  2. Enter distance: Input your trip distance.
  3. Enter efficiency: Input your vehicle's fuel efficiency (MPG or L/100km), or work it out from a fill-up.
  4. Enter fuel price: Input the current price per unit of fuel, whether gasoline, diesel or petrol, per gallon or liter.
  5. View results: See total fuel cost, the fuel cost per mile, cost per passenger, and open Trip Extras or Compare Vehicle for more detail.

Frequently Asked Questions

Enter the total distance, your vehicle's fuel efficiency (MPG or L/100km), and the current fuel price. The calculator estimates total fuel cost as: Cost = (Distance / MPG) × Price per Gallon. The same three entries show what it costs to drive anywhere, and Fuel Needed shows the gas usage for the trip, in gallons or liters.

Related Calculators

A result is an estimate from the numbers you enter and the formulas shown, not financial or tax advice. What a result is, and is not.

Last updated