Trip fuel cost per mile calculator
Enter what a finished trip really cost in fuel and the 500 miles (804.672 km) you drove, and get the cost per mile and per kilometer for your expense records or vehicle log. Any currency works. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Fuel spent
- 72.5
- Distance
- 500
- Distance unit
- Mi
- Currency
- USD
- Precision
- 4
- Distance miles
- 500
- Distance kilometers
- 804.672
- Cost per mile
- 0.145
- Cost per kilometer
- 0.0901
This trip fuel cost per mile calculator converts a completed journey’s actual fuel spending and distance driven into comparable per-mile and per-kilometer rates. Enter the amount paid for fuel, the odometer or route distance, and whether that distance is in miles or kilometers. The result reports both unit rates, so expense records, vehicle logs, and route comparisons can use a consistent basis without estimating fuel economy or local pump prices.
Measure the trip you actually completed
A forecast fuel calculator starts with expected consumption and a price per gallon or liter. This calculator answers a different question: what did fuel actually cost for each mile or kilometer of a specific completed trip? Add the fuel charges that belong to the journey and enter the distance driven from an odometer, mileage log, or reliable route record.
The calculator divides actual fuel spending by actual distance, which makes it useful after travel rather than before it. If the trip cost 72.50 in your chosen currency and covered 500 miles, the direct rate is 0.145 currency units per mile. The same result is also converted to a per-kilometer rate using the exact international relationship of one mile to 1.609344 kilometers.
A currency label can identify USD, EUR, GBP, or another accounting unit, but it is descriptive only: the tool never fetches exchange rates or changes the amount. Keep all fuel entries in one currency and include only purchases assigned to the measured distance. If a fill-up partly covers another trip, allocate that receipt first using your normal expense policy.
This narrow definition produces a rate that can be reconciled with receipts and a mileage record instead of mixing planned and observed values. Zero fuel spending is valid for a reimbursed or fully credited trip and returns zero rates, but distance must be greater than zero because a cost per unit cannot be calculated over no travel.
Understand the unit conversion and rounding
The core formula is total fuel spent divided by distance driven. When distance is entered in miles, that quotient is the cost per mile, while distance multiplied by 1.609344 supplies kilometers for the second quotient. When distance is entered in kilometers, the calculator divides kilometers by 1.609344 to obtain miles and then reports both rates.
These two outputs describe the same trip, so cost per kilometer is numerically lower than cost per mile even though total spending does not change. Precision controls how many decimal places appear, from zero through twelve, and defaults to four. Increasing precision is helpful for fleet exports where a small rate is later multiplied by many trips; lower precision is convenient for a quick expense note.
Negative spending, zero or negative distance, NaN, Infinity, unsupported units, and fractional precision settings are rejected as invalid input rather than silently corrected.
Use the rate in expense and fleet records
Cost per mile or kilometer is most useful as a normalized observation. A freelancer can attach the result to a client-trip expense entry, keeping the original fuel receipts and distance evidence alongside it. A fleet manager can calculate the rate for each route, vehicle, or reporting period and compare like units even when one source log records miles and another records kilometers.
A delivery team can watch repeated routes for changes that deserve investigation, such as congestion, idling, fuel-price movement, driving behavior, or a maintenance issue. The output is not a statutory mileage reimbursement rate and does not include depreciation, insurance, tolls, parking, maintenance, electricity, lodging, or driver time. It measures fuel spending only, so label it clearly when combining it with broader operating-cost reports.
For clean comparisons, use the same receipt allocation rule and trip boundary every time. A full-tank method, for example, works best when both the starting and ending fuel levels are comparable; otherwise one journey may appear artificially expensive while the next appears cheap. The free browser version is suited to occasional receipt reconciliation.
Because the calculator does not convert currencies, compare rates only after amounts share one currency. Because it does not infer distance from fuel volume, retain the original odometer or route source for auditability.
What you can do with it
Business trip expense tracking
Turn fuel receipts and logged mileage into an actual fuel-only rate that can be attached to a client or project expense record.
Fleet route comparison
Normalize completed routes to cost per mile and kilometer so vehicles and logs using different distance units remain comparable.
Delivery cost monitoring
Track repeated delivery runs and flag changes in actual fuel cost per distance for later operational review.
FAQ
What formula does the calculator use?
It divides total fuel spending by distance driven. It converts the same trip with 1 mile equal to 1.609344 kilometers and reports both unit rates.
Does it calculate a legal mileage reimbursement rate?
No. It reports actual fuel spending per distance only. It does not apply tax authority rates or include maintenance, insurance, depreciation, or other vehicle costs.
Can I use any currency?
Yes. Keep the fuel amount in one currency and optionally supply its label. The calculator echoes the label but does not perform currency conversion.
Why must distance be greater than zero?
A per-mile or per-kilometer rate requires a positive denominator.
How is this different from a fuel cost estimate?
An estimate starts from expected fuel economy and a pump price before you travel. This calculator works afterwards, dividing what you actually paid by the distance you actually drove, so the rate matches your receipts and mileage log.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/travel/trip-cost-per-mile \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"fuel_spent":72.5,"distance":500}'const res = await fetch("https://api.kit.forhosting.com/travel/trip-cost-per-mile", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"fuel_spent": 72.5,
"distance": 500
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/travel/trip-cost-per-mile",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"fuel_spent": 72.5,
"distance": 500
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/travel/trip-cost-per-mile", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"fuel_spent":72.5,"distance":500}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"fuel_spent":72.5,"distance":500}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/travel/trip-cost-per-mile", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"fuel_spent": 72.5,
"distance": 500
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "travel.trip_cost_per_mile",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The browser calculation is free, while an automated API request costs $0.002.
Understand the unit conversion and rounding
Rounding affects displayed response fields only after the calculation, not the distance conversion used to find the rates. Inputs may be JSON numbers or ordinary decimal strings, but they must be finite. The calculation uses no network, current date, random sampling, fuel-price database, or vehicle assumption, so the same request always returns the same JSON.
Use the rate in expense and fleet records
Automated systems can call the identical API for $0.002 per request and store fuel_spent, distance, normalized distances, both cost rates, currency label, precision, and method with the expense record.
Technical questions
How much does the API cost?
The calculator is free in the browser. Each successful automated API request costs $0.002.