The basic formula
Fuel mileage, in any unit, is the ratio of distance to fuel. The US version:
MPG = D ÷ V
where D is the distance in miles and V is the volume of fuel consumed in US gallons.
Numerically: a fill-up covering 315.5 miles and using 12.85 gallons gives 315.5 ÷ 12.85 = 24.55 MPG. That is the whole calculation; everything else on this page is what to do with the result, the conversions, and the error analysis.
The two inputs (D and V) are both measurements, and both have measurement error. Section 1 of the factors guide covers where the error comes from; the bottom of this page covers how it propagates through the formula.
Where 235.214583 comes from
The conversion between MPG and L/100km looks like a magic number until you derive it. The constant 235.214583 is just the product of two unit conversions, in the right order:
L/100km = 235.214583 ÷ MPG
235.214583 = 100 ÷ 1.609344 × 3.785412
where 1.609344 is km per mile, 3.785412 is L per US gallon, and 100 is the per-100-km scaling.
Walking through it: a US gallon is 3.785412 L, and a mile is 1.609344 km. To get L per 100 km, you divide (gallons × 3.785412 L/gallon) by (miles × 1.609344 km/mile ÷ 100 km/100km), which gives 378.5412 ÷ 1.609344 = 235.214583. The same constant works the other way: MPG = 235.214583 ÷ L/100km.
For km/L, the conversion is MPG × 0.425144, which is just (3.785412 ÷ 1.609344) ÷ 2.5. The 2.5 is the difference between MPG (miles per gallon) and km/L (kilometers per liter), where 1 km/L is roughly 2.352 MPG (US).
Two warnings. First, the UK gallon is 4.546 L, not 3.785 L. A "40 MPG" UK figure is a "33 MPG" US figure for the same car. Second, the conversion factor 235.21 is rounded; using 235.214583 in spreadsheets and code keeps the accumulated error below 0.01 percent across the 10 to 100 MPG range, which matters for fleet work and doesn't matter for personal tracking.
Worked example: MPG to L/100km and back
Take 28.5 MPG (US), a typical combined rating for a non-hybrid compact car.
L/100km = 235.214583 ÷ 28.5 = 8.25 L/100km
Back-check: MPG = 235.214583 ÷ 8.25 = 28.5
The round trip closes exactly (to 4 decimal places) because the same constant is used both ways. The error in the original MPG is preserved; if the MPG was measured to 3 significant figures, the L/100km is also accurate to 3 significant figures.
For worked conversions across vehicle classes (Camry Hybrid 52 MPG to L/100km, F-150 V6 23 MPG to L/100km, etc.), the conversion guide has the table.
Statistical Analysis and Mathematical Accuracy
Fuel mileage calculations benefit from statistical analysis to improve accuracy and identify measurement trends over multiple calculation cycles.
Average Calculation Methods
Simple Average Formula
Average MPG = (MPG₁ + MPG₂ + ... + MPGₙ) ÷ n
Where n = number of individual calculations
Weighted Average Formula (Recommended)
Weighted MPG = Total Distance ÷ Total Fuel
= (D₁ + D₂ + ... + Dₙ) ÷ (V₁ + V₂ + ... + Vₙ)
Accounts for varying trip lengths more accurately
Statistical Accuracy Measures
Evaluate calculation reliability using mathematical statistical measures:
Key Statistical Formulas
Standard Deviation:
σ = √[(Σ(x - μ)²) ÷ n]
Where x = individual MPG values, μ = mean MPG, n = sample size
Coefficient of Variation:
CV = (σ ÷ μ) × 100%
Values <10% indicate consistent measurements
Confidence Interval (95%):
CI = μ ± (1.96 × σ ÷ √n)
Provides range of expected true efficiency
Statistical Analysis Example
Sample Data: 24.2, 25.1, 23.8, 24.9, 24.3 MPG
Mean (μ): (24.2 + 25.1 + 23.8 + 24.9 + 24.3) ÷ 5 = 24.46 MPG
Standard Deviation (σ): 0.51 MPG
Coefficient of Variation: (0.51 ÷ 24.46) × 100% = 2.09%
Interpretation: Excellent measurement consistency (<5% variation)
Error propagation: how input error becomes result error
For a quotient (MPG = D ÷ V), the relative error in the result is the quadrature sum of the relative errors in the inputs:
Relative error in MPG = √[(ΔD/D)² + (ΔV/V)²]
Where ΔD is the absolute error in the distance measurement and ΔV is the absolute error in the volume measurement.
For a typical fill-up:
- Distance: 300 miles, odometer readable to 0.1 mile, so ΔD/D = 0.03%.
- Volume: 12 gallons, pump readable to 0.01 gallon, plus pump calibration error of about 0.5%.
- ΔV/V = √(0.08%² + 0.5%²) = 0.51% (the pump calibration dominates).
- Combined error: √(0.03%² + 0.51%²) = 0.51%.
For a 25.0 MPG result, the propagated error is ±0.13 MPG, or 24.87 to 25.13 MPG. That is the realistic accuracy of a single fill-up before you add the variation from driving conditions, fill-level consistency, and pump-to-pump differences. Three to five fill-ups averaged reduces the random error by √n, so a 5-fill-up sample is accurate to about 0.23%, or 24.94 to 25.06 MPG.
Temperature correction for fuel volume
For fleet or compliance work where you need to compare volume-based measurements to a standard reference temperature (60°F / 15.6°C in the US, 15°C in the EU), gasoline's volume changes by about 0.00094 per degree Fahrenheit. The correction formula:
Vₖ₀ = V × [1 + β × (T₂ - T₁)]
where V is the measured volume, β is the thermal expansion coefficient (0.00094 per °F for gasoline), T₂ is the standard temperature, and T₁ is the actual fuel temperature.
A 15-gallon fill measured at 80°F is 15 × [1 + 0.00094 × (60 - 80)] = 15 × 0.981 = 14.72 gallons at the standard 60°F. For personal MPG tracking this is in the noise; for fleet reporting against a tax or regulatory threshold, the correction matters.
The cost formulas
Three derived calculations that come up often:
Trip fuel cost: Cost = (Distance ÷ MPG) × Fuel Price
Annual fuel cost: Cost = (Annual Miles ÷ MPG) × Average Fuel Price
Cost per mile: Cost = Fuel Price ÷ MPG
Worked: a 12,000-mile-per-year driver with a 22 MPG truck and a $3.95/gal fuel price pays 12,000 ÷ 22 × $3.95 = $2,155/year in fuel, or $0.18/mile. A 35 MPG sedan at the same miles and price costs 12,000 ÷ 35 × $3.95 = $1,354/year, or $0.11/mile. The annual difference is $801.
The savings calculator on the homepage does this calculation with current gas prices and your specific numbers.
Range checks for validating results
Before trusting a calculated MPG, sanity-check it against the plausible range:
Reasonable vehicle MPG: 5 to 150 MPG
EPA-rating band: 0.5 ≤ (Calculated ÷ EPA Rating) ≤ 1.5
Single fill-up distance: 10 to 2,000 miles
Single fill-up volume: 0.1 to 200 gallons
A result outside the band usually means an input error (transposed digits in the odometer, fuel in liters against an odometer in miles, a partial fill-up being treated as a full one). The calculator runs these checks on the inputs before showing the result.