Commute cost calculator
Driving 12 miles each way at 28 mpg with 15 a day in parking costs 18 a day, while a 6.5 transit fare saves 253 a month. Enter distance, fuel use, prices and fare in one currency to see which option wins and by how much. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Distance
- 12
- Fuel efficiency
- 28
- Fuel price
- 3.5
- Parking
- 15
- Transit fare
- 6.5
- Trips per day
- 2
- Workdays per month
- 22
- Daily drive distance
- 24
- Fuel used daily
- 0.8571428571
Choosing how to get to work is partly about time and comfort, but the money question is usually the one that decides a long-term habit: is driving cheaper than the train or bus once fuel, parking, and round-trip distance are honest numbers? This commute cost calculator turns five everyday inputs—one-way distance, vehicle fuel efficiency, fuel price, daily parking, and a full-day transit fare—into clear daily and monthly totals for both options, plus which mode wins and by how much. Defaults assume a two-leg round trip and twenty-two workdays per month so monthly figures match a typical pay-period mental model without forcing you to invent a custom calendar.
Who compares commute costs this way
Households and remote-hybrid workers use a commute cost calculator before buying a monthly transit pass or renegotiating parking so the cheaper mode is chosen on arithmetic rather than gut feel. Relocation and real-estate sites embed the same logic so a listing’s distance to the office becomes a monthly wallet impact next to rent. Employers and mobility benefits teams estimate whether a transit stipend covers what employees would otherwise spend on fuel and parking, using fixed workday counts for apples-to-apples plan design.
Personal-finance educators and spreadsheet courses need a deterministic oracle that rejects negative prices instead of silently flipping signs in a student workbook.
What you can do with it
Household drive-or-train decisions
Plug in your one-way miles, mpg, gas price, parking, and daily transit fare to see which mode costs less per day and per typical work month.
Relocation and office-distance planning
Turn commute distance into monthly driving versus transit totals when comparing neighbourhoods or hybrid schedules.
FAQ
What units should I use for fuel efficiency?
Use distance per unit of fuel (mpg or km/L) matching your distance unit. Do not enter L/100km; convert to km/L first if needed.
How is the daily cost of driving worked out?
The one-way distance is multiplied by the trips you make, two by default, then divided by your fuel efficiency and multiplied by the fuel price. Parking is added on top: 24 miles at 28 mpg and 3.5 a gallon is 3 in fuel, plus 15 parking makes 18.
What should I enter as the transit fare?
The full amount you pay for one commuting day: two single tickets, a day pass, or your share of a monthly pass divided by the workdays you use it. It is compared directly with the daily cost of driving.
How are the monthly totals calculated?
Each daily total is multiplied by the workdays in a month, 22 by default to match a typical pay period. If you work from home some days, lower that number so both monthly totals reflect your real schedule.
What if I pay nothing for parking or only drive one way?
Set parking to zero when your garage or street spot costs nothing. If you drive only one leg a day, set the trips per day to one, and the fuel cost is halved accordingly.
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/life/commute-cost-compare \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"distance":12,"fuel_efficiency":28,"fuel_price":3.5,"parking":15,"transit_fare":6.5}'const res = await fetch("https://api.kit.forhosting.com/life/commute-cost-compare", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"distance": 12,
"fuel_efficiency": 28,
"fuel_price": 3.5,
"parking": 15,
"transit_fare": 6.5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/life/commute-cost-compare",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"distance": 12,
"fuel_efficiency": 28,
"fuel_price": 3.5,
"parking": 15,
"transit_fare": 6.5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/life/commute-cost-compare", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"distance":12,"fuel_efficiency":28,"fuel_price":3.5,"parking":15,"transit_fare":6.5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"distance":12,"fuel_efficiency":28,"fuel_price":3.5,"parking":15,"transit_fare":6.5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/life/commute-cost-compare", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"distance": 12,
"fuel_efficiency": 28,
"fuel_price": 3.5,
"parking": 15,
"transit_fare": 6.5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "life.commute_cost_compare",
"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 engine is pure finite arithmetic with no network calls, no maps, and no date-dependent shortcuts, so the free browser tool and the API path always agree. Use it free on this page for a quick decision, or call the API at $0.002 per successful request when budgeting apps, relocation planners, or HR mobility tools need reproducible commute-cost comparisons.
What driving versus transit cost means in this calculator
Daily driving cost is the sum of fuel burned for the full workday distance and any parking you pay that day. Parking is added as a daily cash cost; if your garage is free, set parking to zero. One-way distance is multiplied by trips per day (two by default for a classic home-to-office-and-back pattern) to get daily_drive_distance. Fuel used that day is daily_drive_distance divided by fuel_efficiency, where efficiency is distance per unit of fuel such as miles per gallon or kilometres per litre—not litres per hundred kilometres. Fuel money is that volume times fuel_price in the same currency you use for parking and transit. Transit cost for the day is simply transit_fare: enter the total you actually pay for that commuting day, whether that is two one-way tickets, a day pass, or your fair share of a monthly pass divided by workdays. Monthly figures multiply each daily total by workdays_per_month (default twenty-two). The response also reports difference_daily and difference_monthly as driving minus transit, savings when the modes differ, and a cheaper label of driving, transit, or tie. There is no hidden toll model, insurance premium, vehicle depreciation, or carbon price: those matter in life but are outside this transparent fuel-plus-parking versus fare comparison. Negative distance or negative price fields fail with invalid_input rather than inventing a credit; non-positive fuel efficiency is rejected because division by zero or a negative mpg is not a meaningful vehicle economy.
Input contract, units, defaults, and error behaviour
Keep units consistent: if distance is in miles, use miles-per-gallon efficiency and price per gallon; if distance is in kilometres, use km per litre and price per litre. The calculator does not convert currencies or unit systems. Example: twelve miles one way, twenty-eight mpg, three point five currency units per gallon, fifteen parking, and six point five transit fare with defaults yields a clear pair of daily and monthly totals you can pin in tests. Failed validation is not billed. POST a JSON body with five required finite numbers: distance (one-way length in the same unit as efficiency), fuel_efficiency (positive distance per fuel unit), fuel_price (non-negative price per fuel unit), parking (non-negative daily parking), and transit_fare (non-negative full-day transit cost). Optional trips_per_day defaults to two; optional workdays_per_month defaults to twenty-two; both must be positive when provided. Numeric strings and plain JSON numbers are accepted; non-finite values, missing required fields, and empty strings fail with invalid_input naming the field. On success the body echoes the normalized inputs, daily_drive_distance, fuel_used_daily, drive_fuel_cost_daily, drive_cost_daily, transit_cost_daily, the monthly pair, difference and savings fields, cheaper, a formula string documenting the arithmetic, and precision used for rounding.
Where a commute cost compare API earns its keep
Keep distance and efficiency in matching units, document whether transit_fare is a day pass or two tickets, and you get reproducible comparisons for blogs, calculators, and edge workers without standing up mapping or payroll infrastructure of your own.
Integration use cases
Budgeting apps and mobility stipends
Generate deterministic drive_cost_monthly and transit_cost_monthly fields for benefits design, demos, and CI fixtures.
Technical questions
How is driving cost calculated versus transit?
Daily driving cost is (distance × trips_per_day / fuel_efficiency) × fuel_price + parking. Daily transit cost is transit_fare. Monthly figures multiply each daily total by workdays_per_month (default 22).
Is distance one-way or round-trip?
Distance is one-way. By default trips_per_day is 2, so the engine doubles distance for a round trip. Set trips_per_day to 1 if your distance is already the full daily total.
What happens if distance or a price is negative?
The task fails with invalid_input. Negative distance, fuel_price, parking, or transit_fare is rejected; failed validation is not billed.
What does the commute cost calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.