ForHosting KIT · Science

Speed distance time calculator

Enter any two of speed, distance and time and the third is worked out: a distance of 100 covered in a time of 2 means a speed of 50. It works with any consistent units, for homework, routes or training. 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
100
Time
2
You get
Speed
50
Known values
distance, time

free

One relationship, three questions

Distance equals speed multiplied by time, and that single relationship answers three questions. Give the distance and the time and you get the speed, which is distance divided by time, so 100 over 2 gives 50. Give the speed and the time and you get the distance. Give the distance and the speed and you get the time, which is distance divided by speed. The result also says which two values you entered, so a measured figure is never confused with a derived one.

Units, rounding and common slips

The calculator never assumes kilometres, miles, hours or seconds, so the answer is right as long as both inputs share one coherent system: kilometres and hours give kilometres per hour. Mixing minutes with an hourly speed is the classic slip. Every value must be greater than zero, which also rules out a division by zero. All three numbers, including the two you supplied, are rounded the same way, to 4 decimals by default or anything from 0 to 8, so the figures stay consistent with each other. It suits physics homework, delivery estimates and running or cycling pace alike.

Rounding, decimals and units

The decimals parameter controls precision: it defaults to 4 and accepts any integer from 0 to 8. All three returned numbers, including the two you supplied, pass through the same rounding, so results are internally consistent. The tool is unit-agnostic: it never assumes kilometres, miles, hours or seconds, so as long as your two inputs share a coherent system (for example kilometres and hours yielding kilometres per hour) the derived value is correct.

This keeps one deterministic core usable for physics homework, logistics ETAs, or running-pace conversions alike, without baking any unit assumptions into the arithmetic.

Validation and determinism

Validation is strict before any arithmetic runs. Each supplied value must be a finite number strictly greater than zero, so zero, negatives, NaN, Infinity, or non-numeric types are rejected with a message naming the offending field, which also guarantees the division steps never hit a divide-by-zero. The decimals argument must be an integer between 0 and 8 or it is refused as out of range.

Physics and math homework

Check answers for motion problems by entering any two known quantities and reading back the third, with decimals set to match the required precision.

Logistics and ETA tools

Derive a travel time from a distance and average speed, or a required speed to cover a route within a deadline, using consistent units of your choice.

Pace and fitness apps

Convert between distance, elapsed time and speed for runs or rides, letting the given array tag which figure the user actually recorded.

Which units does it use?

None specifically. It is unit-agnostic, so results are correct as long as your two inputs share a coherent unit system.

How is rounding controlled?

The decimals parameter (default 4, range 0-8) rounds every returned number half-up, away from zero on a tie.

Can inputs be zero or negative?

No. Each provided value must be a finite number greater than zero, which also prevents any divide-by-zero.

How do I work out travel time from distance and speed?

Enter the distance and the speed and leave the time empty. The time is the distance divided by the speed, in the time unit that matches your speed, such as hours for kilometres per hour.

What happens if I enter all three values?

Exactly two of the three must be given, so entering one, three or none is refused with a message asking for two. That way there is never any doubt about which value was worked out.

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/dev/speed-distance-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/dev/speed-distance-time \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"speed":50,"distance":100}'
{
  "speed": 50,
  "distance": 100
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "dev.speed_distance_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.

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.

Give any two of speed, distance and time and it computes the third from distance = speed x time, rounding every field half-up to your chosen number of decimals. API from $0.002.

The core relation

You supply exactly two of the three fields (speed, distance, time) and the engine derives the missing one. The calculator solves the classic relationship distance = speed x time. If you pass distance and time, it computes speed = distance / time; with speed and time it computes distance = speed x time; with speed and distance it computes time = distance / speed. For the sample input of distance 100 and time 2, the response returns speed 50 alongside the echoed distance and time. The output also includes a given array listing the two fields you provided, sorted alphabetically, so the example yields ["distance","time"]. That lets a downstream caller tell which value was measured and which was derived without re-inspecting the original request, which is handy when the same endpoint answers all three kinds of question.

Validation and determinism

Exactly two of speed, distance and time must be present; supplying one, three, or none raises a typed invalid_input error telling you to provide exactly two.

How many values do I provide?

Exactly two of speed, distance and time. The engine computes the third; passing one, three, or zero returns an invalid_input error.

What formula is used?

distance = speed x time, rearranged as needed: speed = distance / time, distance = speed x time, or time = distance / speed.

Read the full KIT documentation →