Calculators
Pythagorean Theorem Calculator
Pick which side of the right triangle is unknown, enter the two known sides, and see the missing side worked out step by step.
c = 5
Hypotenuse of the right triangle
c² = a² + b²
c = √(3² + 4²)
c = √(9 + 16) = √25
c = 5
Area: 6
Perimeter: 12
Pythagorean triples
A Pythagorean triple is a right triangle whose three sides are all whole numbers. The best known is 3-4-5, used on building sites to check that a corner is square — and every multiple of it, such as 6-8-10 or 9-12-15, is also a triple.
- 3² + 4² = 5² (9 + 16 = 25)
- 5² + 12² = 13² (25 + 144 = 169)
- 8² + 15² = 17² (64 + 225 = 289)
- 7² + 24² = 25² (49 + 576 = 625)
- 20² + 21² = 29² (400 + 441 = 841)
Calculated on your device — nothing is sent anywhere.
Works in your browser. No account needed.
Frequently asked questions
What is the Pythagorean theorem formula?
For a right triangle with legs a and b and hypotenuse c, a² + b² = c². The hypotenuse is the side opposite the 90° angle and is always the longest side. Rearranged: c = √(a² + b²) for the hypotenuse, and a = √(c² − b²) for a missing leg.
How do I find a leg when I know the hypotenuse?
Subtract the square of the known leg from the square of the hypotenuse, then take the square root. With c = 13 and b = 5: a = √(169 − 25) = √144 = 12. The hypotenuse must be longer than the known leg — if it is not, no right triangle has those measurements and the calculator says so instead of returning a number.
Can I use it for a triangle without a right angle?
No — a² + b² = c² only holds when one angle is exactly 90°. For any other triangle use the law of cosines, c² = a² + b² − 2ab·cos C, which reduces to the Pythagorean theorem when C = 90° because cos 90° = 0. You can, however, use the theorem in reverse to test whether a corner is square: if the three measured sides satisfy a² + b² = c², the angle opposite c is a right angle.
How do I find the diagonal of a rectangle, a screen or a box?
A rectangle’s diagonal is the hypotenuse of the triangle formed by its width and height, so solve for c. A screen 48 in wide and 27 in tall has a diagonal of √(48² + 27²) = √3033 ≈ 55.07 in. For a box, apply the theorem twice: a 30 × 40 × 120 cm box has a floor diagonal of 50 cm, and a space diagonal of √(50² + 120²) = 130 cm — the longest rod that fits inside.
What units does the calculator use?
The theorem is unit-agnostic, so centimeters, meters, inches or feet all work and the answer comes out in the same unit. Both known sides must use the same unit — convert 5 ft 6 in to 66 in first, for example. Area is then in that unit squared and perimeter in the same linear unit.
What are Pythagorean triples like 3-4-5 used for?
A Pythagorean triple is three whole numbers that satisfy a² + b² = c², such as 3-4-5, 5-12-13 or 8-15-17. Builders use the 3-4-5 rule to set out a square corner: measure 3 units along one edge, 4 along the other, and the diagonal between the marks should be exactly 5. Multiples work the same way, so 6-8-10 ft or 0.9-1.2-1.5 m are common on larger layouts.
About this tool
Choose the unknown side, type the other two, and the missing length appears instantly with the formula substituted line by line — the same layout a teacher expects when a question says “show your working”. The calculator also gives the triangle’s area (½ × a × b) and perimeter, and draws the triangle to scale with the right angle marked, which makes a typo such as 40 instead of 4 obvious at a glance. Results are shown to four decimal places.
Worked example, hypotenuse: legs of 6 and 8. c² = 6² + 8² = 36 + 64 = 100, so c = √100 = 10 — a 3-4-5 triangle doubled. Worked example, leg: a ladder 6 m long, with its foot 1.5 m from the wall (the usual 4-to-1 safety ratio), reaches √(6² − 1.5²) = √33.75 ≈ 5.81 m up the wall. Worked example, distance between two points: from (1, 2) to (7, 10) the horizontal and vertical gaps are 6 and 8, so the straight-line distance is 10.
Most wrong answers come from one of three slips. Putting the longest side in a leg field: the hypotenuse is always the longest side, so if your “c” is shorter than a leg, the labels are swapped. Mixing units: 2 m and 150 cm must become 200 cm and 150 cm before calculating. Rounding too early: keep full precision until the final answer, then round once — rounding c² before taking the square root can shift the last digit.
When the sides you measured come out close to a known triple — say 2.99, 4.01 and 5.02 — the triple is usually the intended answer and the difference is measurement error. The Pythagorean triples panel under the result lists the common whole-number sets for exactly that check, and for setting out square corners on decking, framing and foundations.