Gas Calculator
Enter the distance, your fuel economy and the price of gas to see how much gas the trip needs, the total cost, the cost per person and the cost per mile or kilometer. Switch between US and metric units, turn on a round trip and share the bill with the people riding along.
Last updated November 4, 2026
Miles for US units, km for metric. Up to 100,000.
MPG for US units, L/100 km for metric.
Dollars per gallon (US) or per liter (metric).
Result
Gas cost = $35.00
| Measure | Value |
|---|---|
| Distance driven | 300 miles |
| Gas needed | 10 gallons |
| Total gas cost | $35.00 |
| Cost per mile | $0.117 |
Estimate only. Real fuel economy changes with speed, load, weather and traffic.
Show the work
Formula: gas = distance / fuel economy; cost = gas x price; per person = cost / people
- Entered: 300 miles one way, 30 MPG, $3.5 per gallon, one way, 1 person.
- Distance driven: 300 miles.
- Gas needed: 300 miles / 30 MPG = 10 gallons.
- Cost: 10 gallons x $3.5 = $35.00.
- Cost per mile: $35.00 / 300 = $0.117.
Result: Gas cost = $35.00
How the gas for a trip is calculated
gas needed = distance ÷ fuel economy
cost = gas needed × price
per person = cost ÷ people
The calculation has three short steps. First, divide the distance by your fuel economy to get the amount of gas the trip burns. With miles and MPG the answer is in gallons. Second, multiply that amount by the price of one gallon to get the total cost. Third, divide the total by the number of people if you are sharing it. The cost per mile is the total cost divided by the miles driven, which is a handy number for comparing routes or vehicles.
Metric works the same way with different units. Fuel economy is expressed as liters used per 100 km, so liters = distance ÷ 100 × L/100 km, and the price is per liter. The tool converts to US units internally, using the exact definitions of 1 mile = 1.609344 km and 1 US gallon = 3.785411784 liters, so a trip gives the same cost whichever system you choose.
See how we calculate for the formulas, sources and review schedule behind every calculator.
Round trips and splitting the cost
A round trip doubles the distance you enter, so enter the one-way distance and switch the trip type instead of doubling it yourself. The gas needed, the total and the cost per distance are all calculated on the full distance, while the cost per mile stays the same because both gas and distance double together.
The people field divides the total cost evenly. It counts everyone who is paying, including the driver, so a car with a driver and three passengers is four people. The tool does not add tolls, parking or wear on the car; add those separately if you want them in the split.
Getting a realistic estimate
The result is only as accurate as the fuel economy you enter. The rating on the window sticker is measured under test conditions. Motorway speeds, hills, a roof box, a full load, cold weather, air conditioning and stop-start traffic all lower the real figure. If you track your own tanks, use that number. The MPG calculator turns miles and gallons from a fill-up into a real-world figure you can paste in here.
Prices differ from station to station and change over a long trip, so use the average price you expect to pay. For a long drive, run the numbers twice with a low and a high price to see the range. For a quick check against a fixed budget, you can also work backward: divide the budget by the cost per mile to see how far it will take you.
How to use the Gas Calculator
- Choose US or metric units, and one way or round trip.
- Enter the one-way distance, your fuel economy and the price of gas.
- Enter how many people are sharing the cost, including the driver.
- Read the gas needed, total cost, cost per person and cost per mile, then use Copy, Print or Share.
Worked example
A 300-mile trip each way at 30 MPG with gas at $3.50 a gallon, shared by four people. A round trip is 600 miles, which needs 600 ÷ 30 = 20 gallons. At $3.50 that costs 20 × $3.50 = $70.00, or $17.50 per person and about $0.117 per mile.
| Fuel economy | Gas needed | Total cost | Per person (4) |
|---|---|---|---|
| 20 MPG | 30 gallons | $105.00 | $26.25 |
| 25 MPG | 24 gallons | $84.00 | $21.00 |
| 30 MPG | 20 gallons | $70.00 | $17.50 |
| 40 MPG | 15 gallons | $52.50 | $13.13 |
Frequently asked questions
How do I calculate how much gas I need for a trip?
Divide the trip distance by your miles per gallon. A 300-mile trip at 30 MPG needs 10 gallons, and a round trip needs twice that.
Should I enter the one-way or the round-trip distance?
Enter the one-way distance and choose Round trip. The calculator doubles it for you and shows the full distance in the results.
How do I convert L/100 km to MPG?
Divide 235.215 by the L/100 km figure to get US MPG. You do not need to do it yourself: choose Metric and enter L/100 km directly.
Does the cost per person include the driver?
It divides the total by the number you enter, so count everyone who is paying, driver included, and the split will match what each person owes.
Why is my actual gas cost different from the estimate?
Speed, traffic, hills, load and weather change fuel economy, and prices vary by station. Use an MPG you measured on similar trips for a closer estimate.