The Pythagorean theorem relates the three sides of a right triangle: the square of the hypotenuse equals the sum of the squares of the two legs, a² + b² = c². To find the hypotenuse from the legs, c = √(a² + b²). For legs of 3 and 4, that's √(9 + 16) = √25 = 5. It works only for right-angled (90°) triangles.
Pythagorean Theorem Calculator — hypotenuse from two legs
Legs a = 3 and b = 4.
- a = 3
- b = 4
- c = 5
Quick examples
How it's calculated
- c = √(a² + b²)
- a
- = 3
- b
- = 4
- 5
How it works
The Pythagorean theorem is the fundamental relationship among the sides of a right triangle — one with a 90° angle. If the two shorter sides (the legs) are a and b, and the longest side (the hypotenuse, opposite the right angle) is c, then:
a² + b² = c²
To find the hypotenuse, square both legs, add them, and take the square root:
c = √(a² + b²)
The same equation finds a missing leg if you know the hypotenuse: rearrange to a = √(c² − b²). It applies only to right triangles — the 90° angle is what makes the squares of the sides add up this exactly.
Worked example
A right triangle has legs 3 and 4. Square them, add, and take the root:
c = √(3² + 4²) = √(9 + 16) = √25 = 5
That's the famous 3-4-5 triangle — three whole numbers that fit exactly. Another is 5, 12, 13: √(25 + 144) = √169 = 13. Not every pair comes out whole, though — legs of 1 and 1 give c = √2 ≈ 1.414, an irrational number.
Frequently asked questions
How do I find the hypotenuse?
- Square each leg, add the two squares, and take the square root of the total. For legs 6 and 8: √(36 + 64) = √100 = 10. The hypotenuse is always the longest side and sits opposite the right angle.
How do I find a missing leg instead?
- Rearrange the theorem: if you know the hypotenuse c and one leg b, the other leg is a = √(c² − b²). For a hypotenuse of 13 and a leg of 5: √(169 − 25) = √144 = 12. Just make sure you subtract, since you're solving for a leg, not the hypotenuse.
Does it work for any triangle?
- No — only **right triangles**, those with a 90° angle. For other triangles the relationship between the sides is different (the law of cosines generalises it). If a triangle isn't right-angled, a² + b² won't equal c².
What is a Pythagorean triple?
- A set of three whole numbers a, b, c that satisfy a² + b² = c² exactly, like (3, 4, 5), (5, 12, 13) and (8, 15, 17). Any multiple of a triple is also one — (6, 8, 10) is just (3, 4, 5) doubled. Most side lengths don't form triples, giving an irrational hypotenuse instead.
Can I check whether a triangle is right-angled?
- Yes — if the three side lengths satisfy a² + b² = c² (with c the longest), the triangle has a right angle; this is the converse of the theorem. For example 7, 24, 25 works (49 + 576 = 625), so it's a right triangle.
What units does the answer use?
- Whatever units the legs are in — the theorem is unit-agnostic, so if a and b are in metres the hypotenuse is in metres too. This calculator treats the legs as plain numbers, so just keep both legs in the same unit and the result follows.
How we know this is right
- Last reviewed
- Aug 4, 2026
- Precision
- Rounded to 4 decimal places.
Sources
- Wolfram MathWorld Pythagorean Theorem — Wolfram MathWorld: "For a right triangle with legs a and b and hypotenuse c, a² + b² = c²" · Reviewed Aug 4, 2026