Skip to main content
Pythagorean

Pythagorean Theorem Calculator

Find the hypotenuse or legs of a right triangle using the Pythagorean theorem.

Solve for

b = 4.000a=3.00c = 5.000

Hypotenuse c

√(3² + 4²) = √25

Area (½ab)
6.0000
Perimeter
12.0000
Angle A (opposite a)
36.8699°
Angle B (opposite b)
53.1301°

Common Pythagorean triples

How It Works

This Pythagorean theorem calculator finds the missing side of a right-angled triangle. Give it any two of the three sides — the two short sides (the legs, a and b) or one leg and the long side (the hypotenuse, c) — and it returns the third side, along with the triangle's area, perimeter, and the two non-right angles. It is built for students checking geometry and trigonometry homework, and for anyone doing practical right-angle work: builders and carpenters squaring a corner, someone working out a TV or laptop screen diagonal from its width and height, or calculating a straight-line distance on a map or floor plan.

What the theorem says

The Pythagorean theorem applies only to a right-angled triangle — a triangle with one 90° angle. It states that the square of the hypotenuse (the side opposite the right angle, always the longest side) equals the sum of the squares of the other two sides: a² + b² = c². Here a and b are the two legs that meet at the right angle, and c is the hypotenuse. Geometrically, if you drew a real square on each side of the triangle, the area of the big square on the hypotenuse would exactly equal the combined area of the two smaller squares.

Finding any side

Rearranging a² + b² = c² lets you solve for whichever side is unknown. To find the hypotenuse, take the square root of the sum of the squares of the legs. To find a leg, take the square root of the difference of the squares.

Hypotenuse: c = √(a² + b²)

Leg a: a = √(c² − b²)

Leg b: b = √(c² − a²)

When you are solving for a leg, the hypotenuse must be the longest side, so c has to be greater than the known leg; otherwise c² − leg² is negative and there is no real triangle. This calculator detects that and asks you to fix the input instead of showing a wrong answer.

Worked example

Suppose a ladder leans against a wall. Its foot is 6 m from the wall and the wall contact point is 8 m up. How long is the ladder? The ladder is the hypotenuse, with legs 6 and 8. Square them: 6² = 36 and 8² = 64. Add: 36 + 64 = 100. Take the square root: √100 = 10. So the ladder is 10 m long. Notice 6-8-10 is just the famous 3-4-5 triple doubled. Enter a = 6, b = 8 above and the calculator returns c = 10, an area of ½ × 6 × 8 = 24, and a perimeter of 24.

Pythagorean triples

A Pythagorean triple is a set of three whole numbers that satisfies a² + b² = c² exactly, with no rounding. The smallest is 3-4-5; others include 5-12-13, 8-15-17, and 7-24-25. Any multiple of a triple is also a triple, so 3-4-5 scales to 6-8-10, 9-12-15, and so on. Builders exploit this with the "3-4-5 method": measure 3 units along one edge and 4 along the other, and when the diagonal between those marks is exactly 5 units, the corner is a perfect right angle.

Tips and real-world uses

The theorem works in any consistent unit — metres, centimetres, feet or pixels — as long as all three sides use the same unit. It underlies straight-line ("as the crow flies") distance: the distance between two points equals √((Δx)² + (Δy)²), which is exactly the hypotenuse of a right triangle. Screen sizes quoted as a diagonal come from the same formula applied to the screen's width and height. In construction and carpentry it is the quickest way to check that walls, frames, and tile layouts are truly square.

Common mistakes

The most frequent error is adding the squares when finding a leg — for a leg you must subtract. Another is forgetting to take the square root at the end: a² + b² gives c², not c, so the final step is always √. Make sure the hypotenuse is correctly identified as the longest side and the one opposite the right angle. And remember the theorem holds only for right-angled triangles; for any other triangle you need the law of cosines instead.

Frequently Asked Questions

Discovered (or at least popularized) by Pythagoras (~570 BC), it states that in any right triangle, the square of the hypotenuse (longest side, opposite the right angle) equals the sum of squares of the other two sides. It works in any unit and is fundamental to geometry, trigonometry, and many real-world calculations.

Part of Geometry Calculators — compare every related calculator in one place.