Missing side of a right triangle
Find the third side of a right triangle from the two you know: legs of 3 and 4 give a hypotenuse of 5, and a hypotenuse of 13 with a leg of 5 gives 12. Pairs that cannot form a right triangle are refused. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- A
- 3
- B
- 4
- Missing side
- 5
- Missing
- c
- C
- 5
A right triangle is defined by one interior angle of ninety degrees, and once any two of its three sides are known the third length is fixed by the Pythagorean theorem. This missing-side calculator answers that single question: you already have two positive lengths and you need the unknown side, not the angles and not the area. Send both legs to recover the hypotenuse as the square root of the sum of squares, or send the hypotenuse with one leg to recover the other leg as the square root of the difference of squares.
What a missing-side Pythagorean solve actually computes
A right triangle has one interior angle of exactly ninety degrees. The two sides that form that right angle are the legs, conventionally labelled a and b; the side opposite the right angle is the hypotenuse c and is always the longest side.
If you already know any two of those three lengths, the Pythagorean identity c squared equals a squared plus b squared rearranges into a closed form for the unknown: the hypotenuse is the positive square root of the sum of the two leg squares, and a missing leg is the positive square root of the hypotenuse square minus the known-leg square.
That identity is not a search, a fit, or a numerical iteration — it is one addition or subtraction of squares and one square root, and this capability encodes that closed form end to end. Classic triples appear immediately: legs three and four yield missing side five; hypotenuse thirteen with known leg five yields twelve; scaled copies such as legs six and eight yield ten. Irrational results such as legs one and one are returned as floating-point values rounded for stable comparison across runtimes.
Because the hypotenuse is the longest side, it must strictly exceed each known leg; a hypotenuse shorter than a given leg cannot sit opposite a right angle in Euclidean geometry, and an equal pair would collapse the missing leg to zero. The calculator therefore refuses those pairs instead of returning a zero, a complex number, or a silently swapped assignment of which side is which.
It also refuses any given side that is not a positive finite number, so a zero run, a negative cut, or a non-numeric token never looks like a successful third-side solve.
When finding the third side is useful
Classrooms and tutoring platforms use a missing-side of a right triangle calculator so learners can verify the third length without mixing up which formula applies: two legs versus hypotenuse plus one leg. Construction and layout tools convert any two measured members — two runs, or a diagonal plus one rise — into the remaining cut length before ordering stock. Game engines and physics sandboxes spawn right triangles from whichever pair the designer already stored and need the complementary extent without pulling a full geometry library.
Exam generators and LMS plugins need a deterministic oracle that rejects a non-positive side and a hypotenuse that is not the longest side instead of taking absolute values and marking swapped homework as correct. The landing is deliberately narrower than a full right-triangle solver: it does not return angles or area, so the page stays aligned with the search for the third side rather than competing with a complete triangle kit.
What you can do with it
Classroom third-side checks
Students enter any two sides of a right triangle to verify the missing length against textbook 3-4-5 and 5-12-13 exercises with a deterministic oracle.
Construction cut from two measured sides
Convert two measured members — two legs, or a brace hypotenuse plus one rise or run — into the remaining cut length before ordering or cutting material.
Games and layout scripts
Recover the complementary side from whichever pair the scene already stores, without importing a full geometry computer-algebra system.
FAQ
How do I find the missing side of a right triangle from two sides?
Send exactly two of a, b, and c as positive finite numbers.
Which two sides do I send — legs, hypotenuse, or either pair?
Either pair. Both legs recover the hypotenuse. The hypotenuse plus one leg recovers the other leg.
What if a given side is zero, negative, or not a finite number?
Every given side must be a positive finite number. Invalid input is not billed.
Why is the missing side rejected when the hypotenuse is not the longest side?
A Euclidean right triangle requires the hypotenuse to be strictly longer than each leg. A shorter or equal hypotenuse cannot yield a positive missing leg, so the pair is rejected.
Does it also give the angles or the area?
No. It answers one question, the length of the missing side, using the Pythagorean theorem. Next to the result you see all three sides and the formula used, ready to copy into your work.
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/math/missing-side-of-a-right-triangle \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a":3,"leg_a":1}'const res = await fetch("https://api.kit.forhosting.com/math/missing-side-of-a-right-triangle", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a": 3,
"leg_a": 1
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/missing-side-of-a-right-triangle",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a": 3,
"leg_a": 1
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/missing-side-of-a-right-triangle", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a":3,"leg_a":1}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a":3,"leg_a":1}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/missing-side-of-a-right-triangle", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"a": 3,
"leg_a": 1
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.missing_side_of_a_right_triangle",
"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
Every given side must be a positive finite number; zero, negative, infinite, and non-numeric values fail with invalid_input and are not billed.
Input contract, response shape, and error behaviour
Failed validation is not billed. POST a JSON body with exactly two of the three sides: a and b are the legs that meet the right angle, and c is the hypotenuse opposite that angle. Each field may arrive as a JSON number or as a numeric string; a also accepts the aliases leg_a, side_a, and leg1, b accepts leg_b, side_b, and leg2, and c accepts hypotenuse, hyp, and long_side. Missing the pair, sending only one side, or sending all three sides fails with invalid_input asking for exactly two known sides. A given side that is zero, negative, infinite, NaN, or not a decimal number fails with invalid_input naming the field and stating that a positive finite number is required. A hypotenuse that is shorter than a known leg, or equal to it, also fails with invalid_input so a swapped 5-and-13 pair never looks like a real triangle. On success the body returns missing_side as the recovered length, names the unknown in missing as a, b, or c, echoes the completed triple, restates the identity in the formula field, and sets method to missing_side_of_a_right_triangle so clients can distinguish this landing from a hypotenuse-only or missing-leg-only solver. Example: a equals three and b equals four yields missing_side five with missing c. Example: a equals three and c equals five yields missing_side four with missing b. Pair the structured JSON with your own drawing code if you need a sketch; this endpoint returns numbers only and does not emit SVG, step-by-step prose beyond the field names, or unit conversion between metres and feet — you supply both known lengths already in one consistent unit.
Where a missing-side right-triangle API earns its keep
Keep requests small, pin the rounded missing_side in tests, and you get reproducible geometry for homework, edge workers, and design scripts without standing up symbolic math infrastructure of your own.
Technical questions
What does the missing side of a right triangle calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.