calculators.dev

Fuel Cost Calculator

Before a road trip or a daily commute, it helps to know what the gas will cost. This fuel cost calculator turns three numbers — the distance, your car's fuel economy, and the price per gallon — into the gallons of fuel you will burn and the dollars you will spend. It is the quick estimate to reach for when you are comparing routes, splitting costs, or budgeting a long drive.

Calculate

Default result: $35.00

Total miles you plan to drive.

Your car's miles per gallon.

Fuel Cost Calculator · Materials

calculators.dev

Total fuel cost

$35.00

300 × 30 × 3.5

Shopping list

Fuel needed (gallons)
10.00

Est. total

$35.00

Estimate — confirm w/ supplier · calculators.dev

$35.00

Reviewed by the calculators.dev team · Last updated 2026-06-24

Formula reviewed against U.S. EPA / fueleconomy.gov — fuel economy (MPG) is miles driven per gallon of fuel

How to calculate

Enter the trip distance in miles, your car's MPG, and the current price per gallon. The calculator divides the distance by the MPG to find the gallons needed, then multiplies by the price per gallon for the total cost. A 300-mile trip at 30 MPG needs 10 gallons; at $3.50 per gallon that is $35. To estimate a round trip, enter the full there-and-back distance.

gallons = distance ÷ MPG, then cost = gallons × price per gallon. For example, 300 miles ÷ 30 MPG = 10 gallons, and 10 gallons × $3.50 = $35.00. Highway and city MPG differ, so use a realistic figure for the kind of driving you will do.
Example calculation

A 300-mile trip in a car that gets 30 MPG uses 10 gallons of gas. At $3.50 per gallon, the fuel for the trip costs $35. Driving a less efficient car or paying more per gallon raises the total.

cost
$35.00
gallons
10.00

Assumptions

  • Fuel economy is treated as a single constant figure; real MPG varies with speed, terrain, load, and traffic.
  • The price per gallon is the average you expect to pay; prices change between stations and over the trip.
  • The result is fuel only — it does not include tolls, parking, or wear and tear.

Common mistakes

  • Entering one-way distance when you mean a round trip — double the miles for there and back.
  • Using the optimistic EPA highway MPG for stop-and-go city driving, which understates the cost.
  • Forgetting that fuel price varies along the route, so the figure is an estimate, not an exact bill.

Frequently asked questions

How do I calculate the cost of gas for a trip?

Divide the trip distance by your car's MPG to get the gallons needed, then multiply by the price per gallon. For a 300-mile trip at 30 MPG and $3.50 per gallon, that is 10 gallons × $3.50 = $35.

Should I use city or highway MPG?

Use the figure that matches your driving. Highway MPG is higher, so use it for mostly-highway trips; use city or a blended figure for stop-and-go driving, or the cost will be understated.

Does this include a round trip?

Only if you enter the round-trip distance. The calculator uses whatever distance you type, so add the return miles if you want the cost of the full there-and-back journey.

Why is my real fuel cost different?

Real MPG changes with speed, traffic, terrain, and how heavily the car is loaded, and pump prices vary by station. The result is a close estimate, not an exact total.