Gas calculator: how much will gas cost for my trip?

Enter how far you are going, your car’s miles per gallon and the price at the pump. You get the gallons and the gas cost for the trip, one way or there and back, and what each person pays if you share.

Gas cost calculator

I want to know what gas costs for 300 miles one way at 25 mpg, with gas at $3.50 a gallon.

Units Miles, mpg and gallons, or kilometers, L/100 km and liters. Your numbers are converted.
One way, in miles, for example 300.
Trip A round trip doubles the distance.
Miles per gallon, for example 25. Check your car’s dashboard or window sticker.
Dollars per gallon at the pump, for example 3.50.
1 to 100. Use 1 if you pay alone.

Gas cost

$42.00 in gas

A 300-mile trip one way at 25 mpg uses 12 gallons of gas, which costs $42.00 at $3.50 a gallon.

  • 12 gallonsGas needed
  • $84.00There and back
  • $0.14Per mile
  • $14.00Per 100 miles
Did this answer your question?

An estimate for planning. Real fuel use depends on speed, traffic, load, weather and the car, and prices change from station to station.

How the gas calculator works it out

  1. Distance: 300 miles one way.
  2. Gas needed = distance ÷ mpg = 300 ÷ 25 = 12 gallons.
  3. Cost = gallons × price = 12 × $3.50 = $42.00.

What the same trip costs if the price is a little lower or higher, so you can see what a cheaper station saves. The marked row is your price.

PriceTrip costPer mi
$3.00$36.00$0.12
$3.25$39.00$0.13
$3.50$42.00$0.14
$3.75$45.00$0.15
$4.00$48.00$0.16

How to use the gas calculator

  1. Units: keep US for miles, mpg and gallons, or choose Metric for kilometers, L/100 km and liters. The numbers you typed are converted, and your choice is remembered.
  2. Trip distance: type the distance one way. A map app shows it when you plan the route.
  3. Trip: choose Round trip if you drive back the same way; the distance is doubled.
  4. Fuel economy: type your car’s miles per gallon. The trip computer on the dashboard shows your real average; the window sticker or fueleconomy.gov gives the official rating.
  5. Gas price: type the price per gallon at the pump, with cents, for example 3.49.
  6. People: type how many people share the cost to see what each one pays.

When to use a gas calculator

Use the gas calculator before a road trip to budget for fuel, to compare driving with a train or plane ticket, to decide how much friends should chip in for a ride, or to see what a daily commute costs a month. A business or volunteer trip often needs the fuel cost on paper too.

Try a few values to see what makes the biggest difference: a car with better mpg, a cheaper station, or driving one way only. For a drive abroad, switch to metric or convert with miles to km and mph to km/h. To split the rest of the trip costs, use the tip calculator, which also splits a check.

Gas calculator at a glance

What it does

Divides the miles by your mpg to get the gallons, multiplies by the price per gallon, and doubles it for a round trip or splits it between people.

Who it's for

Drivers planning a road trip, carpoolers sharing the cost, commuters, and anyone comparing driving with other ways to travel.

Watch out for

The mpg you enter is the biggest unknown. City driving, heavy loads and high speeds use more gas than the rating suggests.

How the gas calculator works

Two steps. First work out how much gas the trip needs: gallons = miles ÷ mpg. Then multiply by the price: cost = gallons × price per gallon. Put together, cost = miles ÷ mpg × price. A round trip doubles the miles, and splitting the cost divides the total by the number of people.

With your numbers: 300 miles ÷ 25 mpg = 12 gallons, and 12 × $3.50 = $42.00.

In metric units, fuel use is given the other way around, as liters per 100 kilometers, so you multiply instead of divide: liters = km × L/100 km ÷ 100, then liters × price per liter. To turn mpg into L/100 km, divide 235.21 by the mpg; 25 mpg is 9.41 L/100 km. For distances in the other unit, use miles to km.

The answer is only as good as the mpg you enter. Highway driving at a steady speed usually beats the combined rating, while city traffic, heavy loads, roof boxes, cold weather and high speeds use more. If you are not sure, take a little less than your usual mpg to leave some room in the budget.

Gas calculator: worked examples

How much gas will a 300-mile trip cost at 25 mpg and $3.50 a gallon?

300 ÷ 25 = 12 gallons, and 12 × $3.50 = $42.00 one way, or $84.00 there and back.

Common mistake: multiplying the miles by the mpg. That gives 7,500, which is not gallons; divide the miles by the mpg.

Two friends drive 250 miles each way in a car that does 22 mpg. Gas is $3.299. What does each pay?

500 miles ÷ 22 = 22.73 gallons, × $3.299 = $74.98 in total, so $37.49 each.

Common mistake: forgetting the drive home. One way costs only $37.49 in total, so each would pay half of what the trip really costs.

What does gas cost for a 2,800-mile cross-country trip at 28 mpg and $3.60 a gallon?

2,800 ÷ 28 = 100 gallons, and 100 × $3.60 = $360.00, about 13 cents a mile.

Common mistake: using the highway rating for a trip through cities and mountains. Take a lower mpg to leave room in the budget.

In Europe: 500 km at 7.5 L/100 km with fuel at 1.60 a liter?

500 × 7.5 ÷ 100 = 37.5 liters, and 37.5 × 1.60 = 60.00 in the local currency.

Common mistake: dividing by L/100 km as if it were mpg. L/100 km is fuel per distance, so you multiply; a lower number is a more economical car.

Gas calculator in Excel and Google Sheets

Put the one-way miles in A2, the mpg in B2 and the price per gallon in C2. The same formulas work in Excel and Google Sheets.

Read the table row by row: each row is one cell of your sheet, what to put in it and an example.

CellWhat goes in itExample
A2Distance one way (miles)300
B2Fuel economy (mpg)25
C2Price per gallon3.50
D2Gas cost=A2/B2*C2

Gas cost one way

=A2/B2*C2

Gas cost for a round trip

=2*A2/B2*C2

Cost per person (people in E2)

=D2/E2

Metric: km, L/100 km, price per liter

=A2*B2/100*C2

mpg to L/100 km

=235.215/B2

Format the cost cells as currency, or wrap the formula in =ROUND(…,2) for cents. Gallons alone are =A2/B2.

Gas calculator: frequently asked questions

How do I calculate gas cost for a trip?

Divide the miles by your car’s mpg to get the gallons, then multiply by the price per gallon. 400 miles ÷ 30 mpg = 13.33 gallons, × $3.40 = $45.33.

How much gas will I use for 100 miles?

100 divided by your mpg: 4 gallons at 25 mpg, 3.33 gallons at 30 mpg, 2.5 gallons at 40 mpg.

What is my car’s mpg?

Most cars show the average mpg on the trip computer. You can also fill the tank, reset the trip meter, drive, fill up again and divide the miles by the gallons you added. The official rating is on the window sticker and at fueleconomy.gov.

How do I split gas money with friends?

Work out the cost of the whole trip, there and back, and divide it by the number of people who ride. Set People sharing the cost and the calculator shows each share.

How do I convert mpg to L/100 km?

Divide 235.21 by the mpg. 25 mpg is 9.41 L/100 km and 40 mpg is 5.88 L/100 km. The same division turns L/100 km back into mpg.

Why does another gas calculator show a slightly different cost?

Usually because of rounding: some round the gallons to one decimal before multiplying, or show whole dollars. With the same inputs, the unrounded cost should match to the cent.

Other everyday life calculators

Report a problem with this calculator · Sponsor this calculator