Time of flight calculator
Three numbers decide how long a throw stays airborne when it lands at its launch height: speed, angle and gravity, for example 20 m/s at 45° under 9.81 m/s². Enter them and get the total time in the air. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Initial launch speed
- 20
- Angle
- 45
- Gravitational acceleration magnitude
- 9.81
- Time of flight
- 2.8832080782
- Angle deg
- 45
When you throw or fire something and it lands at the same height it left, the total time it stays in the air is fixed by three numbers: how fast it left, the angle above the horizontal, and the strength of gravity. This capability applies the standard kinematics formula and returns that airborne duration in one deterministic call—no simulation steps, no random sampling, and no network lookup. Students, game designers, and engineers use it to check homework, tune launch parameters, or feed a downstream range and height calculation without reinventing the trigonometry each time.
How to choose units, angles, and gravity
Use any consistent unit system. If speed is in meters per second and gravity is in meters per second squared, time of flight is in seconds; feet per second with feet per second squared also works. The angle is measured in degrees from the horizontal, so forty-five degrees is the familiar mid-range launch that maximizes range on flat ground in vacuum.
Gravity is typically 9.81 near Earth’s surface, about 1.62 on the Moon, or 3.71 on Mars—pass the value that matches your scenario rather than hard-coding Earth only. A zero or downward angle (sin θ ≤ 0) yields a time of flight of zero, because the projectile never rises above the launch height under the flat-landing model. Launch speed must be non-negative; negative speeds are rejected as bad input.
Where this fits in teaching, games, and pipelines
Physics teachers and students use a time-of-flight calculator to verify hand work without spreading spreadsheet formulas that quietly mix degrees and radians. Game and simulation teams use the same formula when an arcade projectile should land on a flat plane after a known delay, then schedule animations or hit checks from that delay. Robotics and sports-science pipelines call it when comparing measured hang time against an ideal model before adding drag or spin corrections.
Pair the result with horizontal range R = v²·sin(2θ)/g or apex height H = (v·sinθ)²/(2g) in your own code when you need the full classic set.
What you can do with it
Homework and lab checks
Confirm the airborne time for textbook problems with known speed, angle, and g before grading or writing up a lab.
Game launch tuning
Pick launch parameters so a projectile stays aloft for a target number of frames on a flat arena.
Ideal model vs. measured hang time
Compare real sports or sensor hang time against the vacuum flat-landing prediction as a first baseline.
FAQ
Are the angle units degrees or radians?
Degrees from the horizontal. Convert from radians yourself before calling if your source data is in radians.
Does it include air resistance or different landing height?
No. It is the ideal flat-landing model only. Different landing heights or drag need a different equation or a numerical trajectory solver.
What is the formula for projectile time of flight?
Multiply the launch speed by the sine of the angle, double it, and divide by gravity. It assumes the projectile lands at the same height it was launched from, with no air resistance.
What gravity should I use for the Moon or Mars?
Use about 1.62 m/s² for the Moon and 3.71 m/s² for Mars, instead of 9.81 near Earth's surface. Lower gravity keeps the same throw in the air much longer.
Why is the time of flight zero for a flat or downward launch?
With an angle of zero or pointing down, the projectile never rises above its launch height, so under the same-height landing model there is no time in the air to count.
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/projectile-time-of-flight \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"launch_speed":20,"angle":45,"gravity":9.81}'const res = await fetch("https://api.kit.forhosting.com/mech/projectile-time-of-flight", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"launch_speed": 20,
"angle": 45,
"gravity": 9.81
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/mech/projectile-time-of-flight",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"launch_speed": 20,
"angle": 45,
"gravity": 9.81
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/mech/projectile-time-of-flight", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"launch_speed":20,"angle":45,"gravity":9.81}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"launch_speed":20,"angle":45,"gravity":9.81}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/mech/projectile-time-of-flight", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"launch_speed": 20,
"angle": 45,
"gravity": 9.81
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "mech.projectile_time_of_flight",
"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
What time of flight means for a flat landing
In introductory projectile motion, the launch point and the landing point share the same vertical coordinate. Under constant gravity and no air resistance, the vertical velocity is v·sin(θ) at launch and decreases linearly until the projectile returns. The full cycle from rise to fall takes T = 2·v·sin(θ)/g seconds when v is launch speed, θ is the launch angle from the horizontal, and g is the magnitude of gravitational acceleration. That single closed form is the entire contract of this tool: you supply the three inputs, and you receive the total airborne time plus an echo of the parameters used. It does not integrate trajectories, drag, or wind, and it does not claim a range or apex unless you combine the result with other formulas yourself. Keeping the scope tight makes the answer stable across browsers and API workers, which matters when the same number must appear in a lab report and an automated test.
How to choose units, angles, and gravity
Gravity must not be zero: division by zero is undefined, and this endpoint rejects that case with an invalid_input error so a failed task is never charged.
Where this fits in teaching, games, and pipelines
Bill only successful API calls at $0.002 per request; invalid gravity or missing fields fail fast without consuming balance.
Technical questions
What formula does the time of flight calculator use?
T = 2 · v · sin(θ) / g for launch and landing at the same height, with θ in degrees from the horizontal and constant gravity with no air drag.
What happens if gravity is zero?
The request fails with invalid_input and the message that gravity cannot be zero. Failed tasks are not charged.
How much does the API cost?
$0.002 per successful request. The on-page tool runs free in your browser with the same analytic core.