Pythagorean Theorem Calculator
Find the hypotenuse of a right triangle from the two legs.
Enter the two shorter sides (legs) of a right triangle to find the hypotenuse using the Pythagorean theorem, plus the triangle’s area and perimeter. Handy for geometry, construction and DIY.
Formula / method
Examples
c = 5
c = 13
The theorem in practice
For a right triangle, the Pythagorean theorem states that the square of the hypotenuse equals the sum of the squares of the two shorter sides, written a squared plus b squared equals c squared. Enter the two legs and this tool returns the hypotenuse as the square root of that sum. The hypotenuse is always the longest side and always sits opposite the right angle.
The result is exact where the numbers form a clean set, such as 3, 4, 5 or 5, 12, 13, and otherwise gives a precise decimal, all calculated in your browser.
When to reach for it
This is the go-to for finding a straight-line (diagonal) distance: the length of a ladder against a wall, the diagonal of a rectangular screen or room, or the gap between two points from their horizontal and vertical separation. Builders use it as the 3-4-5 rule to check that a corner is square.
The theorem only holds for right-angled triangles, so it will not solve a triangle that has no 90-degree corner. If you know the hypotenuse and one leg instead, rearrange to subtract the squares; for area or angles you would need a fuller triangle calculator.
Where it's used
- Finding a TV or monitor's diagonal size from its width and height
- Checking that a framed corner or deck is truly square with the 3-4-5 rule
- Working out how long a rafter or roof slope needs to be
- Figuring how far a ladder's base must sit from a wall to reach a given height
- Measuring the straight-line distance between two points on a grid or map
Real-world examples
- A ladder's base is 1.5 m from a wall and its top reaches 3.6 m up, so the ladder is √(1.5² + 3.6²) ≈ 3.9 m long.
- Building a deck, legs of 3 ft and 4 ft should give a 5 ft diagonal; if they do, the corner is a true right angle.
- The straight-line distance from (0,0) to (6,8) on a map grid is √(6² + 8²) = 10 units.
- A TV panel 27.9 in wide and 15.7 in tall has a diagonal of √(27.9² + 15.7²) ≈ 32 in — a '32-inch' TV.
A bit of history
The relationship a² + b² = c² appears as a list of whole-number triples on the Babylonian clay tablet Plimpton 322, dated to roughly 1800 BC — about a thousand years before Pythagoras of Samos, the Greek mathematician traditionally credited with it.
Did you know?
In 1876, years before he became US president, Ohio congressman James A. Garfield published an original proof of the theorem based on the area of a trapezoid, which he worked out during mathematical discussions with fellow members of Congress.
FAQ
Does this only work for right triangles?
Yes — the Pythagorean theorem applies to right-angled triangles, where c is the side opposite the right angle (the hypotenuse).