Gas Calculator: Fuel Cost for Any Trip

A fuel cost calculator (or gas calculator) uses one formula: trip cost = distance ÷ fuel economy × price per gallon. For example, a 300-mile drive each way is 600 miles round trip. At 28 MPG that uses 600 ÷ 28 = 21.43 gallons, and at $3.50 a gallon the gas costs $75.00, or $37.50 each for two people.

What do you want to work out?

Trip
You enter the gas price. $3.50 is only an example: use the price on the pump or your fuel app, per gallon or per liter. For a car’s official MPG, look it up on fueleconomy.gov (U.S. Department of Energy and EPA); your real mileage depends on speed, traffic, load and weather.
Round-trip fuel cost
$75.00
Driving 600 miles (round trip) at 28 MPG uses 21.43 gallons of fuel. At $3.50 per gallon that costs $75.00, or $37.50 each for 2 people.

Fuel needed21.43 gal
Per person$37.50
Cost per mile$0.125
Distance driven600 miles
Fuel in liters81.12 L
Same economy as8.4 L/100 km = 11.9 km/L
Formula
Trip cost = distance ÷ fuel economy × price per gallon
= 600 ÷ 28 × $3.50 = $75.00
Show steps
  1. Round trip: 300 miles × 2 = 600 miles.
  2. Fuel needed: 600 miles ÷ 28 mi/gal = 21.4286 gallons.
  3. Fuel cost: 21.4286 gallons × $3.50 = $75.00.
  4. Split 2 ways: $75.00 ÷ 2 = $37.50 per person.
  5. Cost per mile: $3.50 ÷ 28 = $0.125. Check: 600 × $0.125 ≈ $75.00.
Picture it
This trip’s cost with other fuel economies
$0$50$100$15016.8 mpg: cost $125.0016.8 mpg22.4 mpg: cost $93.7522.4 mpg28 mpg: your car $75.0028 mpg35 mpg: cost $60.0035 mpg42 mpg: cost $50.0042 mpg
Your carLess or more efficient cars
Trip cost at other gas prices
Each row uses the same 21.43 gallons of fuel.
Price per gallon Trip cost Per person
$2.50 $53.57 $26.79
$2.75 $58.93 $29.46
$3.00 $64.29 $32.14
$3.25 $69.64 $34.82
$3.50 (yours) $75.00 $37.50
$3.75 $80.36 $40.18
$4.00 $85.71 $42.86
$4.25 $91.07 $45.54
$4.50 $96.43 $48.21
Results are estimates. Real fuel use changes with driving style, speed, traffic, terrain, load, tire pressure and weather. Tolls, parking and wear on the car are not included.

How to use the gas calculator

  1. Pick a tab: Trip cost for a drive, Fill-up for the cost to fill the tank, Gas mileage to find your MPG from two fill-ups, or Compare cars for yearly fuel cost.
  2. Enter the distance in miles or kilometers and your car’s fuel economy in MPG, L/100 km or km/L. The calculator converts between units for you.
  3. Type the gas price you see at the pump, per gallon or per liter. No price is loaded automatically, so the result always matches the price you pay.
  4. For a trip, choose one way or round trip and the number of people sharing the cost. Open Show steps to see the working.

Fuel cost formula

Fuel used = distance ÷ fuel economy and fuel cost = fuel used × price per unit of fuel. Put together:

Trip cost = distance ÷ MPG × price per gallon

The units must match. Miles go with miles per gallon and a price per gallon; kilometers go with kilometers per liter and a price per liter. A handy extra is the cost per mile = price per gallon ÷ MPG. At $3.50 and 28 MPG it is $3.50 ÷ 28 = $0.125, so every 100 miles costs $12.50 in gas.

Fuel cost with L/100 km

L/100 km measures fuel per distance, the other way up from MPG, so the formula changes to trip cost = distance ÷ 100 × L/100 km × price per liter. A 500 km drive each way (1,000 km round trip) in a car using 8.5 L/100 km needs 1,000 ÷ 100 × 8.5 = 85 liters. At $1.80 a liter, that is 85 × 1.80 = $153.00.

How to calculate gas mileage (MPG)

  1. Fill the tank and reset the trip meter.
  2. Drive as usual until you need gas, then fill the tank again.
  3. Divide the miles driven by the gallons you just added.

Worked example. You drove 320 miles and the second fill-up took 11.2 gallons: 320 ÷ 11.2 = 28.57 MPG. In metric units that is 8.23 L/100 km. Averaging several tankfuls gives a steadier number than a single one.

Cost to fill up the tank

Fill-up cost = (tank size − fuel already in the tank) × price. A 14-gallon tank at a quarter full holds 14 × 0.25 = 3.5 gallons, so it takes 10.5 gallons to fill. At $3.50 a gallon, that is $36.75. The same tank from empty would cost 14 × $3.50 = $49.00.

MPG to L/100 km and cost per mile

To convert, use L/100 km = 235.215 ÷ MPG (from 1 gallon = 3.785411784 liters and 1 mile = 1.609344 km). The cost per mile column uses a $3.50 gallon.

MPG L/100 km km/L Cost per mile at $3.50
20 11.76 8.50 $0.175
25 9.41 10.63 $0.140
30 7.84 12.75 $0.117
35 6.72 14.88 $0.100
40 5.88 17.01 $0.088
50 4.70 21.26 $0.070

Comparing two cars: why MPG gains shrink

Yearly fuel cost = miles a year ÷ MPG × price. Driving 12,000 miles a year at $3.50 a gallon, a 28 MPG car uses 428.57 gallons ($1,500) and a 40 MPG car uses 300 gallons ($1,050). The more efficient car saves $450 a year, or $2,250 over five years.

Because fuel used depends on 1 ÷ MPG, the same MPG gain saves less as cars get more efficient. Over 10,000 miles, going from 10 to 20 MPG saves 500 gallons, but going from 30 to 40 MPG saves only 83.33 gallons. That is why L/100 km, which measures fuel directly, is easier to compare.

What changes your real fuel cost

Official ratings from fueleconomy.gov, run by the U.S. Department of Energy and the EPA, are a good starting point, but your mileage depends on how you drive. According to fueleconomy.gov:

  • Aggressive driving (speeding, rapid acceleration and braking) can lower gas mileage by roughly 15% to 30% at highway speeds and 10% to 40% in stop-and-go traffic.
  • An extra 100 pounds in the vehicle could reduce MPG by about 1%.
  • Idling can use a quarter to a half gallon of fuel per hour, depending on engine size and air conditioner use.
  • A large, blunt roof-top cargo box can reduce fuel economy by around 2% to 8% in city driving, 6% to 17% on the highway and 10% to 25% at Interstate speeds.

To see the effect on a trip, lower your MPG by the same percent. A 28 MPG car driven 15% worse gets about 28 × 0.85 = 23.8 MPG, and the 600-mile trip above would cost 600 ÷ 23.8 × $3.50 = $88.24 instead of $75.00.

Common mistakes

  • Forgetting the return trip. Choose round trip or double the distance.
  • Mixing units, such as kilometers with MPG or a per-liter price with gallons. Pick matching units in the tool.
  • Treating L/100 km like MPG. For L/100 km, a lower number means a more efficient car.
  • Using the window-sticker MPG for a loaded, fast highway trip. Allow for a lower real-world figure.

Results are estimates for planning, not a quote: gas prices change daily and tolls, parking and wear are not included.

Sources

Checked November 2026:

Gas and fuel cost practice quiz: 10 questions

Test yourself with 10 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.

Question 1 of 10
1. A 240-mile trip in a car that gets 30 MPG, with gas at $3.60 a gallon. What is the fuel cost?

Found a mistake? Let us know!

2. The same 240-mile trip is a round trip and four friends share the gas. How much does each person pay?

Found a mistake? Let us know!

3. You drove 351 miles and refilled with 13.5 gallons. What is your gas mileage?

Found a mistake? Let us know!

4. Gas costs $4.00 a gallon and your car gets 25 MPG. What is the fuel cost per mile?

Found a mistake? Let us know!

5. A car uses 6 L/100 km. How much fuel does a 450 km drive need?

Found a mistake? Let us know!

6. About how many L/100 km is 30 MPG? (Use L/100 km = 235.215 ÷ MPG.)

Found a mistake? Let us know!

7. A 16-gallon tank is at 1/4. Gas is $3.25 a gallon. How much does it cost to fill the tank?

Found a mistake? Let us know!

8. Over 12,000 miles, how many gallons do you save by switching from a 20 MPG car to a 30 MPG car?

Found a mistake? Let us know!

9. Which saves more fuel over the same distance: going from 15 to 20 MPG, or from 40 to 50 MPG?

Found a mistake? Let us know!

10. According to fueleconomy.gov, aggressive driving can lower gas mileage at highway speeds by roughly how much?

Found a mistake? Let us know!

Frequently asked questions

How do I calculate gas cost for a trip?

Divide the total distance by your car’s MPG to get gallons, then multiply by the price per gallon. A 450-mile trip at 30 MPG uses 15 gallons; at $3.40 a gallon that is $51.00.

How much gas does it take to drive 100 miles?

Divide 100 by your MPG. At 25 MPG it takes 4 gallons, at 40 MPG it takes 2.5 gallons. Multiply by the gas price for the cost.

How do I split gas money with friends?

Work out the total fuel cost for the whole trip, including the drive home, and divide by the number of people. $75 shared by three people is $25 each. Set the number of people in the Trip cost tab.

How do I convert MPG to L/100 km?

Divide 235.215 by the MPG. 30 MPG is 235.215 ÷ 30 ≈ 7.84 L/100 km. The same formula works backward: 235.215 ÷ L/100 km gives MPG.

How much does it cost to fill up a gas tank?

Multiply the gallons the tank needs by the price. A 15-gallon tank that is empty costs 15 × $3.50 = $52.50 at $3.50 a gallon. Use the Fill-up tab to start from any gauge level.

Related calculators

Related to This Article

What people say about "Gas Calculator: Fuel Cost for Any Trip, MPG or L/100 km"?

No one replied yet.

Leave a Reply