Skip to content
UniversalCalc

Gas cost calculator: fuel cost for any trip

Enter your car's mpg, the miles and the price of gas, and we'll tell you what the trip costs: in total, per person and per mile.

Updated

The one-way distance.

From your dashboard or the car's window sticker.

$/gal

To split the cost between everyone.

$

Tolls, parking, ferries... Optional.

The default prices are just examples. Replace them with what you pay at the pump for a more accurate result.

Result

Enter the distance and fuel economy to see the result.

How this calculator works

Enter the distance, your car’s fuel economy and the price of gas, and you’ll get the total cost of the trip, the cost per person and per mile, the gallons you’ll need and the CO2 you’ll emit. Turn on round trip to double the distance, and add tolls or parking as extra costs.

The second tab compares two cars on the same trip, the quickest way to answer “would a hybrid or an EV actually save me money?”

The formula

gallons = miles ÷ mpg and cost = gallons × price per gallon

A 300-mile trip in a car that gets 30 mpg uses 10 gallons. At $3.20 a gallon, that’s $32.00, or about 10.7 cents a mile. There and back with four people in the car, it’s $64, which is $16 each.

Your mpg matters more than the gas price

The same 300 miles at $3.20 a gallon:

Fuel economyGallonsCost
25 mpg12$38.40
30 mpg10$32.00
35 mpg8.6$27.43

Use the mpg your dashboard shows over a few tanks if you can: the EPA rating on the window sticker is a good start, but real-world numbers are often lower at highway speeds or with a loaded car.

Premium gas only makes sense if your owner’s manual requires it. The same trip in a car that gets 28 mpg on premium at $4.00 a gallon costs $42.86.

Gas vs. electric

Electric cars are rated in kWh per 100 miles, the figure on their EPA label. An EV that uses 30 kWh per 100 miles needs 90 kWh for the same 300-mile trip: $15.30 at $0.17 per kWh, a typical home electricity price.

Over a year of 12,000 miles, the 30-mpg gas car spends $1,280 on fuel and the EV $612: $668 a year less. That assumes home charging; public fast chargers often cost two or three times as much per kWh, so on long road trips the savings shrink. Try your own numbers in the comparison tab.

Emissions

Burning a gallon of gasoline releases about 19 pounds of CO2, so the 300-mile trip at 30 mpg emits roughly 193 pounds. Diesel emits more per gallon but usually burns fewer gallons for the same distance.

How to spend less on gas

  • Slow down on the highway. Fuel economy drops quickly above 50 to 60 mph.
  • Keep your tires properly inflated. Underinflated tires waste fuel and wear out faster.
  • Travel light. Roof boxes and extra weight cost you mpg on every mile.
  • Shop around for gas. Prices can vary by 20 or 30 cents a gallon within a few miles.

Gas is only part of what a car costs. To add up depreciation, insurance and everything else, try the car cost calculator.

Frequently asked questions

How do I calculate the gas cost of a trip?

Divide the miles by your car's mpg to get the gallons, then multiply by the price per gallon. A 300-mile trip in a car that gets 30 mpg uses 10 gallons; at $3.20 a gallon, that's $32. For a round trip, double the miles.

How many gallons of gas do I need for a trip?

Miles divided by mpg. 300 miles at 30 mpg is 10 gallons; at 25 mpg it's 12. Use your car's real-world mpg from the dashboard rather than the EPA rating if you know it, and add a little margin for mountains, heavy loads or lots of highway speed.

Is it cheaper to drive an electric car?

Usually yes, if you charge at home. An EV that uses 30 kWh per 100 miles costs $15.30 for a 300-mile trip at $0.17 per kWh, against $32 for a 30-mpg gas car at $3.20 a gallon. Over 12,000 miles a year that's $612 against $1,280. Public fast charging costs much more per kWh, so the gap narrows on road trips.

How do I split gas money with friends?

Enter the number of people in the car and the calculator divides the total, tolls included. A $32 trip there and back with four people is $64, or $16 each. Some groups also chip in for wear and tear on the driver's car; if yours does, add it as an extra cost.

How do I convert mpg to liters per 100 km?

Divide 235.2 by the mpg. 30 mpg is about 7.84 L/100 km and 25 mpg is about 9.41. The calculator converts automatically when you change the unit next to the fuel economy field.

Related calculators