On this page
Formula
Gas cost = (Distance ÷ Fuel economy) × Price per gallon
- Distance
- miles driven (doubled for a round trip)
- Fuel economy
- your car's miles per gallon (mpg)
- Price per gallon
- what you pay for one gallon of gas
What the gas cost calculator tells you
Fuel is the one driving cost you pay every week, and it’s easy to estimate before you leave. The gas cost calculator takes three numbers, how far you’ll drive, how many miles your car gets per gallon and what gas costs, and gives you the fuel bill for that drive. It also shows how many gallons (and liters) you’ll burn and what each mile and each kilometer costs you.
It works in both US and metric units. Enter the distance in miles or kilometers, the fuel economy as mpg, L/100 km or km/L, and the price per gallon or per liter. Mixed combinations, such as miles with a price per liter, are converted for you.
How to use the calculator
- Enter the one-way distance and pick miles or kilometers. A route planner or map app gives you this figure.
- Tick Round trip if you’re coming back the same way. The distance is doubled.
- Enter your car’s fuel economy and its unit. If you don’t know it, the EPA combined rating is a reasonable starting point, but your own measured figure is better.
- Enter the fuel price and choose per gallon or per liter. Use the price you expect to pay along the route, not the cheapest station near home.
The result updates as you type. The working underneath shows the gallons or liters used and the multiplication that gives the cost, so you can check it.
How to calculate gas cost by hand
The formula has two steps: work out the fuel, then price it.
Fuel used = Distance ÷ mpg, then Gas cost = Fuel used × Price per gallon.
Say you’re driving 340 miles in a car that averages 31 mpg, with gas at $3.15 a gallon:
- Fuel used: 340 ÷ 31 = 10.97 gallons
- Gas cost: 10.97 × $3.15 = $34.55
- Cost per mile: $34.55 ÷ 340 = about 10.2 cents
Metric version
With L/100 km the fuel step is a multiplication instead of a division: Fuel used = Distance × L/100 km ÷ 100. A 450 km drive in a car using 5.8 L/100 km burns 450 × 5.8 ÷ 100 = 26.1 liters. At $1.62 per liter that’s 26.1 × 1.62 = $42.28.
Cost per mile shortcut
If you just want a rule of thumb, divide the price per gallon by your mpg. At $3.40 and 30 mpg, every mile costs about 11.3 cents, so a 50-mile errand loop costs roughly $5.67.
Gas cost per 100 miles
This table shows what 100 miles costs at common fuel economy figures and gas prices. Scale it up or down for your distance: 250 miles costs 2.5 times the value shown.
| Fuel economy | Gallons per 100 mi | $3.00/gal | $3.50/gal | $4.00/gal | $4.50/gal |
|---|---|---|---|---|---|
| 15 mpg | 6.67 | $20.00 | $23.33 | $26.67 | $30.00 |
| 20 mpg | 5 | $15.00 | $17.50 | $20.00 | $22.50 |
| 25 mpg | 4 | $12.00 | $14.00 | $16.00 | $18.00 |
| 30 mpg | 3.33 | $10.00 | $11.67 | $13.33 | $15.00 |
| 35 mpg | 2.86 | $8.57 | $10.00 | $11.43 | $12.86 |
| 40 mpg | 2.5 | $7.50 | $8.75 | $10.00 | $11.25 |
| 50 mpg | 2 | $6.00 | $7.00 | $8.00 | $9.00 |
Notice that the savings shrink as mpg rises. Going from 15 to 20 mpg saves 1.67 gallons every 100 miles, while going from 40 to 50 mpg saves only half a gallon. That’s why gallons per 100 miles is a fairer way to compare cars than mpg alone.
Ways people use a gas cost calculator
Road trips and round trips
Before a long drive, enter the route distance and tick round trip to see the fuel budget for the whole journey. If you’re also paying for hotels, tolls and meals, the trip cost calculator adds those to the same fuel figure and splits the total per person.
Gas cost per month for your commute
Enter your one-way commute and tick round trip to get the daily cost, then multiply by your working days. An 18-mile commute each way, five days a week for 48 weeks, adds up to 8,640 miles a year. At 30 mpg and $3.40 a gallon, that’s 288 gallons and about $979 a year in gas, or roughly $82 a month.
Comparing two cars
Run the same distance with each car’s mpg to see the gap in dollars. Over a year of driving, the difference between a 24 mpg SUV and a 38 mpg sedan is often several hundred dollars, which is useful when you’re weighing a purchase.
Splitting gas money
For a shared ride, work out the round-trip cost and divide it by the number of riders. It’s a fair, transparent way to settle up.
Common mistakes
- Forgetting the return leg. A one-way figure for a round trip halves your budget. Use the round trip box.
- Using the highway rating for city driving. Stop-and-go traffic can lower mileage a lot. Use your combined or measured average unless the drive really is all highway.
- Mixing US and UK mpg. A UK gallon is about 20% larger than a US gallon, so UK mpg figures look higher for the same car. Convert first with the MPG calculator.
- Ignoring speed and load. A roof box, a full trunk or 75 mph cruising can all push consumption up noticeably, so add a margin for a heavily loaded trip.
- Pricing at the cheapest local station. Fuel near highways and in some states costs more. Use an average price for the route.
Glossary
- Mpg (miles per gallon): how far the car travels on one US gallon. Higher is better.
- L/100 km: liters of fuel used to cover 100 km, the usual measure outside the US. Lower is better.
- Cost per mile: price per gallon ÷ mpg. Handy for mileage reimbursement and comparing cars.
- Round trip: there and back by the same route, so twice the one-way distance.
To see the carbon dioxide from the same gallons of gas, try the car CO2 emissions calculator.
Worked examples
A weekend drive in an SUV
180 miles one way in an SUV averaging 24 mpg, with gas at $3.29 a gallon.
Inputs: Distance (one way) = 180; Distance (one way) unit = Miles; Round trip (double the distance) = No; Fuel economy = 24; Fuel economy unit = Miles per gallon (mpg); Fuel price = $3.29; Price per = Per gallon
Fuel = 180 mi ÷ 24 mpg = 7.5 gal Cost = 7.5 × $3.29 = $24.68
Answer: Driving 180 mi at 24 mpg with fuel at $3.29 per gallon uses 7.5 gal and costs $24.68.
A round trip in metric units
320 km each way (640 km in total) in a car using 6.5 L/100 km, with fuel at $1.85 per liter.
Inputs: Distance (one way) = 320; Distance (one way) unit = Kilometers; Round trip (double the distance) = Yes; Fuel economy = 6.5; Fuel economy unit = Liters per 100 km (L/100 km); Fuel price = $1.85; Price per = Per liter
Distance = 320 km × 2 = 640 km Fuel = 640 km × 6.5 ÷ 100 = 41.6 L Cost = 41.6 × $1.85 = $76.96
Answer: Driving 640 km (round trip) at 6.5 L/100 km with fuel at $1.85 per liter uses 41.6 L and costs $76.96.
A short commute in an efficient hybrid
A 12-mile commute each way (24 miles a day) in a hybrid averaging 52 mpg, with gas at $3.79 a gallon.
Inputs: Distance (one way) = 12; Distance (one way) unit = Miles; Round trip (double the distance) = Yes; Fuel economy = 52; Fuel economy unit = Miles per gallon (mpg); Fuel price = $3.79; Price per = Per gallon
Distance = 12 mi × 2 = 24 mi Fuel = 24 mi ÷ 52 mpg = 0.46 gal Cost = 0.4615 × $3.79 = $1.75
Answer: Driving 24 mi (round trip) at 52 mpg with fuel at $3.79 per gallon uses 0.46 gal and costs $1.75.
Assumptions and limitations
- Fuel used = distance ÷ mpg, or distance × L/100 km ÷ 100 in metric. Every unit is converted internally with exact definitions (1 mile = 1.609344 km, 1 US gallon = 3.785411784 L).
- The fuel economy you enter is treated as constant for the whole drive. Real consumption changes with speed, traffic, load, weather and terrain.
- Mpg means US miles per gallon. For a UK (imperial) mpg figure, convert it first with the MPG calculator.
- A round trip simply doubles the one-way distance. Different routes there and back aren't modeled.
- The cost covers fuel only. Tolls, parking, wear and tear, insurance and depreciation are not included.
- Money is rounded to the cent and cost per mile or km to a tenth of a cent, after the full calculation.
Frequently asked questions
How do you calculate gas cost for a trip?
Divide the distance by your car's mpg to get the gallons you'll use, then multiply by the price per gallon. A 260-mile drive at 26 mpg uses 10 gallons, which costs $34.50 at $3.45 a gallon.
How much does it cost to drive 100 miles?
It's 100 ÷ mpg × the gas price. At 30 mpg and $3.50 a gallon, 100 miles costs about $11.67. At 20 mpg the same distance costs $17.50, and at 40 mpg it costs $8.75.
How do I calculate gas cost per mile?
Divide the price per gallon by your mpg. At $3.60 a gallon and 24 mpg, every mile costs $0.15. The calculator shows this figure, along with the cost per kilometer.
How do you calculate fuel cost per km?
Multiply your L/100 km figure by the price per liter and divide by 100. A car using 7 L/100 km with fuel at $1.50 a liter costs 7 × 1.50 ÷ 100 = $0.105, or about 10.5 cents per kilometer.
How do I split gas money with friends?
Work out the total gas cost for the round trip, then divide by the number of people sharing it. For tolls, parking and lodging split per person, use the trip cost calculator, which divides the full budget.
Should I use the EPA mpg rating or my own?
Your own measured average is more realistic. EPA ratings are good for comparing cars, but fueleconomy.gov notes that your actual mpg will vary with driving style, weather and vehicle condition. You can measure yours at your next fill-up with the MPG calculator.
Does driving faster really cost more in gas?
Yes. According to fueleconomy.gov, gas mileage usually drops quickly above 50 mph, and each 5 mph over 50 is roughly like paying an extra $0.31 per gallon. Aggressive driving can cut highway mileage by 15% to 30%.
Sources
- Gas Mileage Tips - Driving More Efficiently — U.S. Department of Energy and EPA (fueleconomy.gov). Checked October 10, 2026.
- Your Mileage Will Vary — U.S. Department of Energy and EPA (fueleconomy.gov). Checked October 10, 2026.
- Gasoline and Diesel Fuel Update — U.S. Energy Information Administration. Checked October 10, 2026.
- Approximate Conversions from U.S. Customary Measures to Metric — National Institute of Standards and Technology. Checked October 10, 2026.