Pythagorean Theorem Calculator
Solve a right triangle: find the hypotenuse or a missing leg.
Results update as you type.
About this calculator
The Pythagorean theorem states that in a right triangle a² + b² = c², where c is the hypotenuse — the longest side, opposite the right angle. This calculator solves for the hypotenuse from two legs, or for a missing leg from the hypotenuse and one leg, and also reports the triangle's area, perimeter and two acute angles.
To find the hypotenuse, add the squares of the legs and take the square root: a 3-4 right triangle has hypotenuse √(3² + 4²) = √(9 + 16) = √25 = 5. To find a missing leg, rearrange to a = √(c² − b²); because a leg is always shorter than the hypotenuse, the hypotenuse you enter must be the largest side, or the tool flags it. The acute angles come from the arctangent of the legs and always add up to 90°.
This is the workhorse of right-triangle geometry: finding diagonals, checking that a corner is square in construction, computing distances, and deriving the coordinate distance formula. Whole-number side sets like 3-4-5 and 5-12-13 are called Pythagorean triples.
Frequently asked questions
What is the Pythagorean theorem?
For a right triangle, a² + b² = c², where c is the hypotenuse. A 3-4 right triangle has hypotenuse √(9 + 16) = 5.
How do you find a missing leg?
Rearrange to a = √(c² − b²). The leg must be shorter than the hypotenuse, so the hypotenuse value must be the largest side.
What extra values does this tool show?
Besides the missing side, it reports the triangle's area (½ × leg × leg), its perimeter, and the two acute angles.
How are the acute angles found?
From the arctangent of the two legs. In a right triangle the two acute angles always add up to 90°.
What is a Pythagorean triple?
A set of whole-number sides that satisfies a² + b² = c², such as 3-4-5 or 5-12-13. They form exact right triangles with no rounding.
Why must the hypotenuse be the longest side?
It sits opposite the right angle and is always the longest side. When you solve for a leg, the hypotenuse you enter must exceed the known leg or the tool flags it.
API — use this calculator from code
Call this calculator as a free JSON endpoint — no key required. Send the field values below as query parameters or JSON. Read the full API docs →
Endpoint
GET https://calculator.free/api/v1/pythagorean-theorem/
curl
curl "https://calculator.free/api/v1/pythagorean-theorem/?solve=hypotenuse&a=3&b=4"
JavaScript fetch()
const r = await fetch(
"https://calculator.free/api/v1/pythagorean-theorem/?" + new URLSearchParams({
"solve": "hypotenuse",
"a": "3",
"b": "4"
}));
const data = await r.json();
console.log(data.results);
Results are estimates for general guidance only, not financial, medical or tax advice.