Round-trip average speed
Out at 60 and back at 40 over the same distance averages 48, not 50: the calculator takes the harmonic mean, twice the product of the speeds over their sum, and shows the plain average next to it. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Speed1
- 60
- Speed2
- 40
- Average speed
- 48
- Arithmetic mean
- 50
When you travel the same distance outbound and return at two different constant speeds, the overall average speed is not the arithmetic mean of those speeds. Time spent on each leg is distance divided by speed, so slower legs weigh more on the clock. The closed-form result is the two-number harmonic mean: twice the product of the speeds divided by their sum. Drivers, physics students, and exam writers meet this every time a problem states “went at sixty, returned at forty — what was the average speed for the whole trip?”
Why equal-distance average speed is a harmonic mean
Suppose each leg has the same path length d, outbound at speed v1 and return at speed v2. Time on the first leg is d divided by v1; time on the second is d divided by v2. Total distance is two d; total time is d over v1 plus d over v2.
Average speed is total distance over total time, which simplifies algebraically to two times v1 times v2 over v1 plus v2. That expression is exactly the harmonic mean of the two speeds. The arithmetic mean, half of v1 plus v2, answers a different question: the mean of two speedometer readings when each reading is weighted equally in time or equally as samples, not when equal distances force unequal times.
Because more time is spent on the slower leg, the true trip average is always less than or equal to the arithmetic mean, with equality only when the two speeds match. Classic classroom traps use sixty and forty kilometres per hour and invite the wrong answer of fifty; the harmonic mean is forty-eight. The formula assumes equal distances and constant speed on each leg; if the legs have different lengths, you must weight by actual distances or total time instead.
This capability intentionally solves only the equal-distance two-speed case that search users phrase as a round-trip average speed problem, keeping the contract small and the SEO intent focused.
Where round-trip average speed shows up in practice
Secondary-school and entrance-exam physics constantly pose equal-distance outbound and return problems to test whether students reach for the arithmetic mean or derive the harmonic form from first principles. Tutoring platforms and LMS auto-graders need a deterministic oracle that marks fifty wrong when the legs are equal distance at sixty and forty, and that fails cleanly when a student enters zero for one speed.
Driving instructors and fleet trainers use the same identity to show why a slow mountain return pulls the trip mean below the naive mid-point of the two cruising speeds. If you need total distance over wall-clock elapsed time including stops, use a distance-over-time average speed tool; if you need the harmonic mean of an arbitrary list of positive numbers, use a general harmonic mean calculator—those are different search intents and different landings from this two-speed equal-distance round-trip case.
What you can do with it
Homework and entrance-exam checks
Compute the harmonic average speed for two equal-distance legs so students and auto-graders share one closed-form ground truth instead of the arithmetic trap.
Driver training and trip demos
Show why a slow return leg lowers overall trip average speed below the mid-point of outbound and return cruise speeds.
FAQ
What is round-trip average speed for equal distances?
Equal path lengths make total time d÷v1 + d÷v2, so overall speed is 2d over that sum.
Why is it not the arithmetic mean?
You spend more time on the slower leg. The arithmetic mean treats both speeds equally as samples; the trip average weights by time, which yields the harmonic mean for equal distances.
What happens if either speed is zero?
A zero speed on a fixed-distance leg would imply infinite time, so the average is undefined.
What units should I use?
Any consistent speed unit for both legs (km/h, mph, m/s, …). The average is returned in the same unit; this tool does not convert between unit systems.
What does the round-trip average speed calculator cost?
The browser tool is free and runs locally.
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/mech/average-speed-round-trip \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"speed1":60,"speed2":40}'const res = await fetch("https://api.kit.forhosting.com/mech/average-speed-round-trip", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"speed1": 60,
"speed2": 40
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/mech/average-speed-round-trip",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"speed1": 60,
"speed2": 40
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/mech/average-speed-round-trip", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"speed1":60,"speed2":40}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"speed1":60,"speed2":40}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/mech/average-speed-round-trip", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"speed1": 60,
"speed2": 40
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "mech.average_speed_round_trip",
"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
This calculator accepts the two positive speeds in any consistent unit, returns the harmonic average speed plus the arithmetic mean for contrast, and rejects a zero speed with a clear invalid_input error instead of producing infinity.
Input contract, response fields, and validation
Send two required finite numbers under the fields speed1 and speed2. Zero or vanishingly small speeds fail because the formula divides by each speed when expanding total time, and a stationary leg of fixed distance would take infinite time. Negative speeds are rejected as well: this tool reports scalar average speed for path legs, not signed average velocity. Wire the free browser form for homework and quick checks, then call the identical contract from scripts when you need bulk answer keys. They must share the same unit system—both kilometres per hour, both miles per hour, or any other consistent speed unit—because the output average_speed is returned in those same units with no unit conversion. Missing fields, empty strings, non-numeric values, NaN, and Infinity fail with invalid_input naming the field and are not charged. On success the body echoes cleaned speed1 and speed2, average_speed as the harmonic result, arithmetic_mean as the simple half-sum for side-by-side teaching, formula set to the string v_avg equals two times v1 times v2 over v1 plus v2, and method set to harmonic_mean_equal_distance_legs. Example: speed1 sixty and speed2 forty yields average_speed forty-eight and arithmetic_mean fifty. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.
Where round-trip average speed shows up in practice
Curriculum authors building interactive lessons want the same JSON shape offline and online so worksheets and API-backed quizzes stay aligned. Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.
Integration use cases
LMS and quiz answer keys
Mark round-trip average speed items deterministically; reject zero leg speeds as invalid_input rather than returning infinity or a blank success.