Pythagorean Theorem Calculator
Solve a² + b² = c² for any side of a right triangle — find the hypotenuse from two legs, or a missing leg from the hypotenuse and the other leg, with working shown.
Given the two legs
c (hypotenuse)
5
a
3
leg
b
4
leg
c
5
hypotenuse
Angles
Angle A
36.8699°
opposite side a
Angle B
53.1301°
opposite side b
Angle C
90°
the right angle
The calculation
c = √(a² + b²)
c = √(3² + 4²) = 5
Check: a² + b² = 9 + 16 = 25 ≈ c² = 25
Common Pythagorean Triples▾
Three whole numbers that satisfy a² + b² = c² exactly. Tap a row to load its values into the calculator.
The Pythagorean theorem only applies to right triangles — those with a 90° angle. For triangles without a right angle, use the Triangle Calculator with Heron's formula.
How to use this calculator
- Pick what to solve for — the hypotenuse (c) or one of the two legs (a or b).
- Enter the other two sides. For solving a leg, the hypotenuse must be larger than the leg you provide.
- Read the missing side in the result.
How it works
The Pythagorean theorem:
a² + b² = c²
Rearranging:
- Solve for c (hypotenuse):
c = √(a² + b²) - Solve for a (leg):
a = √(c² − b²) - Solve for b (leg):
b = √(c² − a²)
The calculator picks the right rearrangement based on the mode and shows the working underneath, including a sanity check that a² + b² ≈ c² with your numbers.
This only works for right triangles — those with a 90° angle. For any other triangle, use the Triangle Calculator with Heron’s formula.
Frequently Asked Questions
What is the Pythagorean theorem? ▾
The Pythagorean theorem states that for any right triangle, the square of the hypotenuse (the side opposite the 90° angle) equals the sum of the squares of the other two sides: a² + b² = c². It's one of the most famous results in mathematics and dates back to before 500 BC. The calculator lets you solve for any of the three sides given the other two.
What's a right triangle? ▾
A right triangle is any triangle with one 90° angle. The two sides forming that right angle are called legs (a and b), and the third side, opposite the right angle, is called the hypotenuse (c) — always the longest side. The Pythagorean theorem only applies to right triangles. For triangles without a right angle, use Heron's formula in the Triangle Calculator.
How do I find a missing leg if I know the hypotenuse and one leg? ▾
Rearrange a² + b² = c² to solve for the missing leg. If you know c and b, then a = √(c² − b²). The calculator does this in 'Find a' or 'Find b' mode — just enter the hypotenuse and the leg you know. Note that the hypotenuse must always be larger than each leg; if you enter values where it isn't, the formula has no real solution.
Why doesn't the formula work if I enter a leg larger than the hypotenuse? ▾
Because c² − b² would be negative, and you can't take the square root of a negative number to get a real length. Physically, the hypotenuse is always the longest side of a right triangle — if a leg is supposedly longer, you've either swapped your inputs or the triangle isn't a right triangle. The calculator flags this rather than returning a confusing NaN.
What are 'Pythagorean triples'? ▾
Pythagorean triples are three whole numbers that satisfy a² + b² = c² exactly — like (3, 4, 5), (5, 12, 13), (8, 15, 17). They're useful for sanity-checking calculations and for problems where you want clean answers. There are infinitely many: any (k×3, k×4, k×5) for integer k gives one.
Where would I use this in real life? ▾
Construction (squaring a foundation), navigation (straight-line distance between two points on a grid), framing a square corner, the diagonal of a TV or monitor, the shortest distance across a rectangular yard. Anywhere you have a right angle and need the third side.