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.
Show steps
- Round trip: 300 miles × 2 = 600 miles.
- Fuel needed: 600 miles ÷ 28 mi/gal = 21.4286 gallons.
- Fuel cost: 21.4286 gallons × $3.50 = $75.00.
- Split 2 ways: $75.00 ÷ 2 = $37.50 per person.
- Cost per mile: $3.50 ÷ 28 = $0.125. Check: 600 × $0.125 ≈ $75.00.
Trip cost at other gas prices
| 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 |
How to use the gas calculator
- 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.
- 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.
- 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.
- 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)
- Fill the tank and reset the trip meter.
- Drive as usual until you need gas, then fill the tank again.
- 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:
- fueleconomy.gov (U.S. Department of Energy and EPA): Driving More Efficiently
- U.S. Department of Energy, Energy Saver: Driving More Efficiently
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.
Round trip = 480 miles = 16 gallons, costing 16 × 3.60 = $57.60. Split four ways: 57.60 ÷ 4 = $14.40.
235.215 ÷ 30 = 7.84 L/100 km. 12.75 is the km/L value, a different unit.
Fuel in tank = 16 × 0.25 = 4 gallons, so you add 12 gallons. 12 × 3.25 = $39.00.
20 MPG uses 12,000 ÷ 20 = 600 gallons and 30 MPG uses 400 gallons, saving 200 gallons.
Per 1,000 miles, 15 to 20 MPG saves 66.67 − 50 = 16.67 gallons, while 40 to 50 MPG saves 25 − 20 = 5 gallons. Fuel use depends on 1 ÷ MPG.
fueleconomy.gov says aggressive driving can lower gas mileage by roughly 15% to 30% at highway speeds and 10% to 40% in stop-and-go traffic.
Quiz complete
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
More math articles
- 4th Grade WVGSA Math Worksheets: FREE & Printable
- DAT Math Formulas
- Fractional Forecasts: How to Estimate Sums and Differences Using Benchmarks
- Congressional Oversight: Agency Accountability and Limits
- Using Distributive Property to Factor Numerical Expressions
- Pennsylvania PSSA Grade 5 Math Worksheets — 49 Free Printable Single-Skill PDFs
- The CIO, Labor’s Breakthrough and the New Deal’s Exclusions
- Free Grade 7 English Worksheets for Alaska Students
- How to Solve Word Problems of Absolute Value and Integers?
- How to Graph Quadratic Inequalities? (+FREE Worksheet!)


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