ForHosting KIT · Home, food & hobbies

Drive time calculator

180 kilometres at an average of 90 km/h is 2 hours behind the wheel; add a half-hour lunch and the whole trip takes 2 hours 30 minutes. Enter distance, average speed and planned breaks, in kilometres or miles. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Distance
180
Average speed
90
You get
Break time
0
Distance unit
Km
Speed unit
Kmh
Distance km
180

This drive time calculator turns a trip distance and an average moving speed into the hours you will spend behind the wheel, then adds any planned rest so the result is the full trip duration rather than a theoretical moving time. Households use it to decide when to leave for a wedding, whether a same-day return is realistic, and how a lunch stop changes the clock. After distance and speed are expressed in matching length units, driving hours equal distance divided by average speed. Break time is then added as a non-negative offset.

What your drive time result shows

Drive time is the moving duration implied by a known distance and a realistic average speed, not a live traffic forecast and not a clock-face arrival time that depends on when you leave. The closed form is driving hours equals distance divided by average speed, after both quantities have been written in matching length units; total trip duration is that moving time plus any planned break hours.

If you will cover one hundred and eighty kilometres at ninety kilometres per hour, the moving time is exactly two hours; a half-hour lunch then makes the total trip duration two and a half hours. Use a dedicated ETA tool when you already know a departure clock time and need an arrival clock; keep this page when the question is simply how long the drive itself will last.

How distance, speed, units, and breaks are read

When the length units disagree, the engine converts with the exact international mile of 1.609344 kilometres before dividing, so one hundred miles at eighty kilometres per hour is not treated as one hundred divided by eighty. Optional leading plus signs and scientific notation on numeric strings are allowed when they parse as finite decimals; embedded spaces, hex prefixes, and non-numeric tokens are rejected with a clear message so a bad cell does not become a wrong duration.

Distance must be non-negative and at most one million; a negative length is not a trip. Average speed must be strictly greater than zero and at most ten thousand: zero or negative speed cannot compute driving time because division by zero is undefined and a reverse rate is not an average moving speed. Break time must be non-negative and at most seven hundred and twenty hours.

Failed validation is not billed.

Where a drive-time estimate fits in daily planning and software

People meet drive-time thinking when a family asks whether a three-hour window is enough for a stadium, when a caregiver plans a clinic visit with a coffee stop, or when a weekend driver wants the door-to-door duration of a coastal run before booking a restaurant. The same figure helps a small courier quote a same-day window without pretending to know live traffic, and it helps a classroom treat distance-over-speed as a lived quantity rather than an abstract ratio.

Contest and homework practice often needs a fast, offline source of quotients so solutions can be checked without opaque spreadsheet macros under time pressure. Product and education tools use the rate when a learner types a distance and a speed and the interface must show a clean duration next to a break slider. This page is not a multi-day driving-days planner and it is not a physics three-way solver that rearranges for unknown distance or unknown speed.

Same-day family trips

Turn a known highway distance and a conservative average speed into a total trip duration, then add lunch or fuel-stop hours before you promise an arrival window.

Commute and appointment buffers

Estimate how long a clinic, school, or stadium drive will take at a realistic average speed, including a short rest, without inventing live traffic.

What happens if average speed is zero or negative?

Division by zero is undefined, and a non-positive rate is not an average moving speed, so the calculator never returns Infinity or a negative duration.

How are rest stops included in the total?

When the field is omitted it defaults to zero, so total trip duration equals pure driving time.

Can I mix kilometres and miles?

Mixed pairs are converted with the exact international mile before dividing, so 100 miles at 80 km/h is not treated as 100/80.

Does it allow for traffic or tell me when I will arrive?

No. It works out how long the drive lasts from distance, average speed and breaks, with no live traffic, weather or departure time. For an arrival time, add the result to the moment you plan to leave.

Can I see the result in hours and minutes?

Yes. The total appears as hours and minutes, such as 2h 30m, and also as a count of minutes and seconds, so you can copy whichever suits your plan.

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.

POSThttps://api.kit.forhosting.com/life/drive-time

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.

curl -X POST https://api.kit.forhosting.com/life/drive-time \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"distance":180,"average_speed":90}'
{
  "distance": 180,
  "average_speed": 90
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "life.drive_time",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_distance1000000
max_speed10000
max_break_hours720
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Zero or negative speed is rejected with invalid_input so callers never receive Infinity. Successful API calls cost $0.002 per item; failed validation is not charged.

What drive time means and what the response contains

The response echoes the distance, average_speed, break_time, distance_unit, and speed_unit you submitted, plus the normalized distance_km and average_speed_kmh used internally, the intermediate driving_hours and break_hours, and the primary total_hours together with total_minutes and total_seconds. Integer days, hours, minutes, and seconds describe the same total after rounding to the nearest whole second, and driving_formatted plus total_formatted give compact strings such as 2h or 2h 30m that you can print without further arithmetic. A formula string restates total_hours equals distance divided by average_speed plus break_time, and the method tag is distance_over_speed_plus_breaks. There is no map, no live congestion, no weather model, and no departure clock: the engine either divides two finite numbers, adds a non-negative rest offset, and splits the result, or it rejects the input with invalid_input.

How distance, speed, units, and breaks are read

The required fields are distance for the trip length and average_speed for the moving rate, but aliases dist, d, length, and trip_distance for the length, and speed, avg_speed, v, and velocity for the rate, are accepted so spreadsheets, query strings, and typed forms can reuse the same contract. Optional break_time, with aliases breaks, break_hours, rest_hours, and rest_time, is measured in hours and defaults to zero when omitted so a no-stop run stays a one-line division; write 0.5 for a thirty-minute rest and 1.5 for ninety minutes. Optional distance_unit is km or mi and defaults to kilometres; optional speed_unit is kmh or mph and defaults to kilometres per hour. Computation uses ordinary floating-point division and addition, then rounds hours to twelve decimal places and collapses negative zero so JSON goldens stay stable across runtimes.

Where a drive-time estimate fits in daily planning and software

Developers call the contract from scripts to seed deterministic test vectors for itinerary tools, to normalize mixed kilometre and mile inputs before a comparison demo, or to satisfy product statements that demand a total_hours field rather than a hand-waved arrival clock. Pair it with a fuel-cost or cost-per-mile tool when you already know how long you will be on the road and need a cash figure, and keep this endpoint when the question is the duration itself. On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns.

Scripts and itinerary tests

Call the same contract from automation to assert total_hours for mixed kilometre and mile inputs, including the zero-speed invalid_input path.

How is drive time calculated from distance and speed?

Driving hours equal distance divided by average speed after both values are converted to matching length units (kilometres and km/h, using 1 mi = 1.609344 km when needed). Total trip duration is that moving time plus optional break_time in hours.

What does the drive time calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →