How to use the Pythagorean theorem calculator
- Choose the side you want to find: the hypotenuse c, or one of the legs a or b.
- Type the two sides you know. Decimals are fine. Pick a unit if your problem has one.
- Read the answer, the numbered steps and the diagram. Tick Draw the squares on the sides to see why the theorem is about areas.
The diagram is drawn to proportion, so a 3-4-5 triangle really looks like one. The side you solved for is highlighted.
What is the Pythagorean theorem?
In every right triangle (a triangle with one 90° angle), the two shorter sides are called legs and the longest side, opposite the right angle, is the hypotenuse. The theorem says:
a² + b² = c²
In words: the square built on the hypotenuse has exactly the same area as the two squares built on the legs put together. That is why the calculator can draw those squares for you — for a 3-4-5 triangle the areas are 9 + 16 = 25.
| You want | Formula |
|---|---|
| Hypotenuse c | c = √(a² + b²) |
| Leg a | a = √(c² − b²) |
| Leg b | b = √(c² − a²) |
Worked examples
Find the hypotenuse. The legs are 5 and 12.
5² + 12² = 25 + 144 = 169, so c = √169 = 13.
Find a leg. The hypotenuse is 9 and one leg is 6.
a² = 9² − 6² = 81 − 36 = 45, so a = √45 = √(9 × 5) = 3√5 ≈ 6.7082.
The second answer is not a whole number, so there are two ways to write it. The exact answer is the simplified radical 3√5; the decimal 6.7082 is a rounded approximation. Teachers often ask for “simplest radical form” — the calculator gives both. To practise simplifying radicals on their own, try the square root calculator.
Pythagorean triples
When all three sides are whole numbers, they form a Pythagorean triple. The most famous are 3-4-5, 5-12-13, 8-15-17 and 7-24-25. Multiplying a triple by any whole number gives another one: 6-8-10 and 30-40-50 are both scaled copies of 3-4-5. Triples in which the three numbers share no common factor are called primitive. The calculator tells you whenever your sides form a triple and which primitive triple it comes from.
The hypotenuse is always the longest side
If you are solving for a leg and enter a “hypotenuse” that is shorter than (or equal to) the other leg, no right triangle exists: c² − b² would be zero or negative, and you cannot take the square root of a negative number to get a length. The calculator catches this and tells you to check which side is opposite the right angle.
Area, perimeter and angles
Once all three sides are known, the rest is quick. The legs are perpendicular, so they act as base and height: area = ½ × a × b. The perimeter is a + b + c. The two acute angles always add to 90°, and you can find them with trigonometry: angle A (opposite side a) is tan⁻¹(a ÷ b). For a full solution of triangles that are not right-angled, use the triangle calculator.
Where the theorem shows up
- Distance on a grid: the distance between two points is the hypotenuse of a right triangle whose legs are the horizontal and vertical changes. That is exactly what the distance calculator does.
- Diagonals: the diagonal of a rectangle with sides 9 and 12 is √(81 + 144) = 15. TV and phone screen sizes are diagonals.
- Ladders and ramps: a 13 ft ladder with its foot 5 ft from a wall reaches √(169 − 25) = 12 ft up.
- Checking a right angle: builders mark 3 units and 4 units along two edges; if the gap is exactly 5, the corner is square. This is the converse of the theorem.
Frequently asked questions
What is the formula for the Pythagorean theorem?
a² + b² = c², where a and b are the legs of a right triangle and c is the hypotenuse, the side opposite the right angle. To find the hypotenuse use c = √(a² + b²); to find a leg use a = √(c² − b²).
How do I find the hypotenuse of a right triangle?
Square both legs, add the squares, and take the square root of the sum. For legs 6 and 8: 36 + 64 = 100, and √100 = 10, so the hypotenuse is 10.
How do I find a missing leg?
Square the hypotenuse, subtract the square of the leg you know, and take the square root. For hypotenuse 13 and leg 5: 169 − 25 = 144, and √144 = 12.
Does the Pythagorean theorem work for every triangle?
No, only for right triangles. For other triangles use the Law of Cosines, c² = a² + b² − 2ab·cos C, which turns into the Pythagorean theorem when angle C is 90°.
What is a Pythagorean triple?
Three whole numbers that satisfy a² + b² = c², such as 3, 4, 5 or 5, 12, 13. Any multiple of a triple, like 6, 8, 10, is also a triple.
How do I know if a triangle is a right triangle?
Square the three sides. If the two smaller squares add up to the largest square, it is a right triangle. Sides 7, 24, 25 work because 49 + 576 = 625.