Home › Math › Pythagorean Theorem Calculator
Math

Pythagorean Theorem Calculator

Find the missing side of any right triangle — hypotenuse or leg — with the squares worked in the open, plus the triangle's area, perimeter and angles.

Free · No sign-up · Runs in your browser · First published 2026-10-20 · Updated October 2026

The two legs meet at the right angle; the hypotenuse is the longest side, opposite it. Units cancel out — enter feet, metres or centimetres and the answer is in the same unit (areas in square units). Everything is worked out on your own device.

Hypotenuse (c)
—

The oldest formula in the toolbox: square, add, take the root

The Pythagorean theorem is the rule that connects the three sides of a right-angled triangle: the square on the longest side — the hypotenuse, opposite the right angle — equals the squares on the two shorter sides added together. It is how a builder checks that a corner is truly square, how a ladder's reach is worked out before it leaves the ground, and how the diagonal of a screen, a door frame or a garden bed is known before anything is cut. This calculator applies the theorem in both directions: give it the two legs and it finds the hypotenuse; give it the hypotenuse and one leg and it finds the leg that is missing — rearranging the same equation, not a different one. Every result shows its squares, so the working can be checked by hand, and the page finishes the triangle off with its area, perimeter and two sharp angles. For the root step itself, the square root calculator shows the same arithmetic standalone.

The formulas, with every term defined

c = √(a² + b²) — the hypotenuse from the two legs
Missing leg = √(c² − known leg²) — either leg from the hypotenuse and the other leg
Area = a × b ÷ 2 · Perimeter = a + b + c
Bar chart of the squares in the worked example: 3 squared is 9, 4 squared is 16, and their sum 25 is 5 squared
The worked example below, drawn as bars: the two leg squares add to the hypotenuse square.

Read it in words. a and b are the legs: the two sides that meet at the right angle. c is the hypotenuse: the side opposite the right angle, and always the longest of the three. a² means a multiplied by itself — picture a real square drawn on that side, because the theorem is literally about areas: the square built on the hypotenuse has exactly the area of the two squares on the legs combined. Finding a side therefore runs in two steps: square and combine, then take the square root to get back from an area to a length. Finding a leg runs the film backwards — subtract the known leg's square from the hypotenuse's square first, then root. The angles come from the finished triangle: the angle opposite a is the arctangent of a ÷ b, the angle opposite b is whatever remains of 90°, and the three angles of any triangle sum to 180°.

Worked example: the 3–4–5 triangle

The defaults above enter legs of 3 and 4. Square them: 3² = 9 and 4² = 16. Add: 9 + 16 = 25. Root: √25 = 5 — the hypotenuse. The check line under the result rebuilds it in the open: 9 + 16 = 25, and 5 squared is 25. The rest of the triangle follows: area = 3 × 4 ÷ 2 = 6.00, perimeter = 3 + 4 + 5 = 12.00, and the angles are 36.87° opposite the side of 3 and 53.13° opposite the side of 4, plus the 90° right angle — summing to 180°, as they must. Leg mode round-trips it: enter hypotenuse 5 and known leg 4, and √(25 − 16) = √9 = 3, the leg you started with.

Triangles whose sides are all whole numbers

Leg aLeg bHypotenuse cThe squaresAreaPerimeter
3 (worked example)459 + 16 = 256.0012.00
5121325 + 144 = 16930.0030.00
681036 + 64 = 10024.0024.00
8151764 + 225 = 28960.0040.00
7242549 + 576 = 62584.0056.00
202129400 + 441 = 841210.0070.00

Whole-number sets like these are called Pythagorean triples, and builders have used the smallest of them for millennia: measure 3 units along one wall and 4 along the other, and when the diagonal reads exactly 5 the corner is square — the 3–4–5 check needs no protractor. Notice that 6–8–10 is just 3–4–5 doubled, and 9–12–15 is it trebled: scaling a triple by any whole number gives another triple, which is why the same few shapes recur at every size. Not every right triangle is a triple, of course: legs of 2 and 3 give c = √13 = 3.6056, with area 3.00, perimeter 8.61 and angles 33.69° and 56.31° — an honest irrational answer, printed to four decimal places rather than rounded into a fake whole number. Two real jobs in leg mode: a 13 ft ladder whose foot stands 5 ft from a wall reaches √(169 − 25) = √144 = exactly 12 ft up it, and the diagonal of a 12 by 9 rectangle is √(144 + 81) = √225 = exactly 15 — the same rectangle arithmetic the square footage calculator prices by area.

Reading a triangle answer honestly — the limits

Three cautions belong with any result here. The theorem is only for right triangles. If the corner is not exactly 90°, a² + b² = c² does not hold and the answer is quietly wrong — for a general triangle you need the law of cosines, which takes an angle as an input. The hypotenuse is always the longest side: if leg mode refuses your numbers because the "hypotenuse" is shorter than the known leg, the measurements are not describing a right triangle at all — recheck which side is which before rechecking the arithmetic. And real corners are rarely perfect: a wall that is 89° instead of 90° will measure a diagonal slightly off the figure here, which is a fact about the wall, not the maths. Measure the two legs carefully, in the same unit, from the same corner — the theorem itself has been exact for about two and a half thousand years.

Frequently asked questions

What is the Pythagorean theorem formula?

a squared plus b squared equals c squared, where a and b are the two legs that meet at the right angle and c is the hypotenuse opposite it. To find the hypotenuse, add the squares of the legs and take the square root: legs of 3 and 4 give 9 + 16 = 25, and the root of 25 is 5. The calculator shows those squares under every result so the working can be checked.

How do I find a missing leg when I know the hypotenuse?

Rearrange the same formula: square the hypotenuse, subtract the square of the known leg, and take the square root of what is left. A hypotenuse of 13 with a leg of 12 gives the square root of 169 minus 144 — the root of 25 — which is 5. Leg mode on this page runs exactly that calculation, and refuses the job if the hypotenuse is not longer than the known leg, because in a right triangle it must be.

What is a Pythagorean triple?

A set of three whole numbers that fits the theorem exactly, so the hypotenuse comes out whole with no rounding: 3-4-5, 5-12-13, 8-15-17 and 7-24-25 are the classic small ones, listed with their squares in the table above. Any multiple of a triple is another triple — 6-8-10 is 3-4-5 doubled — which is why builders use the 3-4-5 layout to check that a corner is square.

Can this calculator solve a triangle that is not right-angled?

No — and it will not pretend to. The theorem holds only when one angle is exactly 90 degrees. A triangle without a right angle needs the law of cosines, which also requires knowing one of the angles. If you are measuring a real corner that might be slightly off square, treat the answer here as the ideal the measurement is being compared against.

Why is my hypotenuse answer not a whole number?

Because most right triangles are not triples. Legs of 2 and 3 give the square root of 13, which is 3.6056 to four decimal places — an irrational number that never terminates. The calculator prints four decimal places rather than rounding it into a whole number that would be wrong; for building work, 3.61 in the same unit is the practical figure.

Ahsan ul Haq
Editor, ToolFigure

Every ToolFigure calculator is checked against hand-worked examples before it is published — the same worked examples you can follow on each page. More about ToolFigure →

Related tools

Calculators that show their working

Free forever · No sign-up · Every result comes with its formula and a worked example.

Browse all tools