How to Calculate Fuel Cost
Calculate total fuel cost and cost per mile for any road trip.
The Formula
(distance / mpg) * gasPriceThe fuel cost formula uses the mathematical relationship: (distance / mpg) * gasPrice. Each variable in the formula represents a measurable quantity that affects the final result.
What Each Variable Means
Every value in the fuel cost formula, what it measures, and the value used in the worked example on this page:
| Variable | Type | Example value |
|---|---|---|
| Distance (miles) | Input (you provide) | 300 |
| Fuel Efficiency (MPG) | Input (you provide) | 30 |
| Gas Price ($/gallon) | Input (you provide) | $3.5 |
| Gallons Needed | Result (calculated) | — |
| Total Fuel Cost | Result (calculated) | — |
| Cost Per Mile | Result (calculated) | — |
| Cost Per Km | Result (calculated) | — |
Step-by-Step Method
- 1Write down the values you know: Distance (miles), Fuel Efficiency (MPG), Gas Price ($/gallon).
- 2Substitute your known values into the formula: (distance / mpg) * gasPrice.
- 3Work through the arithmetic in the standard order of operations — parentheses first, then exponents, then multiplication and division, then addition and subtraction.
- 4Check that your result carries the correct unit and falls in a reasonable range for the problem.
- 5Verify your answer with the interactive Fuel Cost Calculator — it solves the same formula instantly.
Worked Example
Take a concrete case: distance (miles) = 200, with the other inputs at the typical values from the variables table above. Substituting into the formula gives gallons needed = 6.67, total fuel cost = 23.33, cost per mile = 0.117, cost per km = 0.072. These numbers are solved by the same engine that powers the Fuel Cost calculator, so you can reproduce them exactly by entering the same inputs there.
| Distance (miles) | Gallons Needed | Total Fuel Cost | Cost Per Mile | Cost Per Km |
|---|---|---|---|---|
| 80 | 2.67 | 9.33 | 0.117 | 0.072 |
| 200 | 6.67 | 23.33 | 0.117 | 0.072 |
| 300 | 10.00 | 35.00 | 0.117 | 0.072 |
| 400 | 13.33 | 46.67 | 0.117 | 0.072 |
| 500 | 16.67 | 58.33 | 0.117 | 0.072 |
| 600 | 20.00 | 70.00 | 0.117 | 0.072 |
| 800 | 26.67 | 93.33 | 0.117 | 0.072 |
| 900 | 30.00 | 105.00 | 0.117 | 0.072 |
| 1,000 | 33.33 | 116.67 | 0.117 | 0.072 |
How each result changes as distance (miles) changes, holding the other inputs constant.
Practice Problems
1. 300-mile road trip, 30 MPG: Distance (miles) 300, Fuel Efficiency (MPG) 30, Gas Price ($/gallon) $3.5 — work it out, then check the answer.
Answer: Entering Distance (miles) 300, Fuel Efficiency (MPG) 30, Gas Price ($/gallon) $3.5 gives Gallons Needed 10.00, Total Fuel Cost $35.00, Cost Per Mile $0.117, Cost Per Km $0.072.
2. Plug in Distance (miles) 3,500, Fuel Efficiency (MPG) 25, Gas Price ($/gallon) $3.75. What is the answer?
Answer: The calculator returns Gallons Needed 140.00, Total Fuel Cost $525.00, Cost Per Mile $0.150, Cost Per Km $0.093 for Distance (miles) 3,500, Fuel Efficiency (MPG) 25, Gas Price ($/gallon) $3.75.
Frequently Asked Questions
What is the formula for fuel cost?
The formula is: (distance / mpg) * gasPrice. Calculate total fuel cost and cost per mile for any road trip.
What values do I need to calculate fuel cost?
You need distance (miles), fuel efficiency (mpg), gas price ($/gallon). The calculator produces gallons needed, total fuel cost, cost per mile, cost per km from those inputs.
What is the fuel cost when distance (miles) is 200?
With distance (miles) = 200, the result is gallons needed = 6.67, total fuel cost = 23.33, cost per mile = 0.117, cost per km = 0.072. This is worked through in full in the example on this page.
Related Topics
Use the Interactive Calculator
Skip the manual math — get instant results with our free Fuel Cost calculator.
