Pythagorean Theorem Calculator

In short: a² + b² = c². The classic 3 and 4 give a hypotenuse of exactly 5, with angles of 36.87° and 53.13° opposite them. Pick the side you want in "Solve for", enter the other two, and the full triangle (sides, angles, area, perimeter) comes back.

One equation, three directions

The theorem ties the three sides of a right triangle so tightly that any two determine the third: the hypotenuse from the legs with c = √(a² + b²), or a leg from the hypotenuse and the other leg with a = √(c² − b²). This page solves in all three directions and adds the two acute angles, the area and the perimeter, because a triangle is usually wanted whole rather than as a single side. The constraint that makes the geometry honest is enforced rather than hidden: the hypotenuse must be the longest side, so an impossible input (a "hypotenuse" shorter than a leg) is reported as impossible instead of producing a NaN or a quietly wrong number. That refusal matters in practice, because swapped fields (a leg typed into the hypotenuse box) are the most common error users make with this theorem, and a calculator that answers anyway teaches the wrong lesson. Beyond the classroom, the theorem is the working tool behind the 3-4-5 builder's square-up, every diagonal measurement from TV screens to foundation footprints, and the distance formula in coordinate geometry, which is the theorem wearing a graph's clothes. Navigation uses it constantly at small scales (a boat 3 km east and 4 km north of harbour is 5 km away, whatever the compass path between), as does computer graphics, where the length of every vector on screen is a hypotenuse computed millions of times a second. The angles this page reports come from the same triangle: the angle opposite a leg is the arctangent of that leg over the other, which is why a complete answer needs nothing beyond the three sides and the patience to check them twice.

Common triples

abcNote
345The builder's triple
51213
81517
72425
202129Nearly isosceles
68103-4-5 doubled

Worked example: squaring a foundation

Problem: a rectangular foundation is marked out at 9 m by 12 m. Is it truly rectangular? Check: the diagonal of a true rectangle would be √(81 + 144) = √225 = 15 m exactly (the 3-4-5 triple scaled by 3). Measure both diagonals: if one reads 15.00 and the other 15.18, the corners are not square and the frame must shift until the diagonals match, because equal diagonals plus equal opposite sides is what rectangular means in practice. The same three numbers, 9, 12, 15, are doing the work that a theodolite would do, at the price of a tape measure. Gardeners laying out a rectangular bed, tilers starting a floor and anyone hanging a projector square to a wall are all solving this same triangle, whether or not they name it.

Frequently asked questions

How do I find a missing leg instead of the hypotenuse?

Rearrange the theorem: a = sqrt(c squared - b squared). The hypotenuse must be the longest side, so if the number under the root comes out negative, the inputs are impossible (the 'hypotenuse' you entered is shorter than the leg) and the calculator says so rather than inventing a result. Example: hypotenuse 13, one leg 5, the other leg is sqrt(169 - 25) = sqrt(144) = 12.

What are Pythagorean triples and why do builders care?

Triples are whole-number sides that satisfy the theorem exactly: 3-4-5, 5-12-13, 8-15-17, 7-24-25 and every multiple of them (6-8-10, 9-12-15). Builders and carpenters use the 3-4-5 rule to set out a true right angle on site: measure 3 units along one edge, 4 along the other, and adjust until the diagonal is exactly 5. It needs no instrument beyond a tape, and it scales: 60-80-100 cm works as well as 3-4-5 m.

Does the theorem work for triangles that are not right-angled?

No, and the failure is informative. For a general triangle the law of cosines generalises it: c squared = a squared + b squared - 2ab cos(C), where the extra term vanishes exactly when C is 90 degrees. You can also run the theorem in reverse as a test: if a squared + b squared equals c squared for the longest side c, the triangle is right-angled; if the left side is larger, the angle opposite c is acute, and if smaller, obtuse.

How do I use it for a ladder or a diagonal?

A ladder against a wall is a right triangle: the ladder is the hypotenuse, the wall and ground are the legs. A 5 m ladder with its foot 1.5 m from the wall reaches sqrt(25 - 2.25) = 4.77 m up it. Screen and room diagonals are the hypotenuse direction: a 55-inch TV's diagonal with 16:9 sides comes from sides in that ratio satisfying the same equation, which is why our inches converter works the diagonal example from the sides.

Who proved the theorem, and is it really Pythagoras?

The relationship was known in practice a millennium before Pythagoras: Babylonian tablets (around 1800 BCE) list triples, and Indian and Chinese texts used it for surveying and astronomy. Pythagoras's school is credited with the first general proof in the Greek tradition, and hundreds of distinct proofs exist today, including one by US President James Garfield. The name stuck to the proof's populariser, not its discoverer, which is common in mathematics.

Note: for right triangles only; the angle opposite the hypotenuse is 90 degrees by definition. For non-right triangles, the law of cosines is the generalisation. Units are whatever you enter, as long as all three sides share them; the angles, area and perimeter follow from the sides alone.

Related calculators

Theorem applications and triples table last verified: 23 November 2026. Everything is calculated in your browser — nothing you type is sent anywhere.