
Trip fuel cost calculator
Estimate fuel used and trip cost from the distance, fuel economy and price you enter.
Your inputs stay in your browser.
Method and assumptions
Method version 1.0.0 · Updated
Estimate trip cost
Formula: Fuel volume used × price per selected volume unit.
Estimate based on your inputs. You provide the fuel price; the result uses the same currency and excludes tolls and other costs.
- distance
- Trip distance
- distanceUnit
- Distance unit
- consumption
- Vehicle fuel economy
- consumptionUnit
- Fuel economy unit
- fuelPrice
- Fuel price
- fuelPriceUnit
- Price per volume
Fuel price is entered by the user and the result stays in that currency. Conversions use 1 mi = 1.609344 km, 1 US gallon = 3.785411784 L, and 1 imperial gallon = 4.54609 L. The estimate does not account for traffic, terrain or changing fuel economy.
Calculate with code
These short examples use the same inputs and core calculation as this tool. Adapt validation and formatting to your application.
JavaScript
const km = 240, litersPer100Km = 6.5, pricePerLiter = 1.8;
console.log(km * litersPer100Km / 100 * pricePerLiter); // 28.08TypeScript
const km = 240, litersPer100Km = 6.5, pricePerLiter = 1.8;
const cost: number = km * litersPer100Km / 100 * pricePerLiter;
console.log(cost); // 28.08Python
km, consumption, price = 240, 6.5, 1.8
print(km * consumption / 100 * price) # 28.08Java
double cost = 240 * 6.5 / 100 * 1.8;
System.out.println(cost); // 28.08C#
decimal cost = 240m * 6.5m / 100 * 1.8m;
Console.WriteLine(cost); // 28.08