On this page
Formula
a² + b² = c², so c = √(a² + b²) and b = √(c² − a²)
- a, b
- the legs, the two sides that meet at the right angle
- c
- the hypotenuse, the longest side, opposite the right angle
What the Pythagorean theorem says
In any right triangle, the square of the hypotenuse equals the sum of the squares of the two legs:
a² + b² = c²
The legs a and b are the two sides that form the right angle. The hypotenuse c is the side opposite the right angle, and it’s always the longest side. Geometrically, the theorem says that a square built on the hypotenuse has the same area as the squares on the two legs combined. It’s named after the Greek mathematician Pythagoras, although Babylonian clay tablets show the relationship was in use more than a thousand years earlier.
How to use the Pythagorean theorem calculator
The calculator has three tabs, one for each question you might be asking:
- Find the hypotenuse. Enter both legs. You get c, plus the two acute angles, the area and the perimeter.
- Find a missing leg. Enter the leg you know and the hypotenuse. The calculator solves b = √(c² − a²).
- Check a right triangle. Enter three side lengths in any order. You’ll see whether they form a right triangle, or whether the triangle is acute, obtuse or impossible.
Pick a unit (inches, feet, yards, miles, millimeters, centimeters, meters or kilometers), or choose “No unit” for textbook problems. The working shows the squares, their sum or difference and the final square root. When the answer is irrational, you also get the exact simplest radical form.
How to use the Pythagorean theorem by hand
Finding the hypotenuse
A rectangular room measures 10 ft by 12 ft. How long is the diagonal from corner to corner?
- Square the legs: 10² = 100 and 12² = 144.
- Add them: 100 + 144 = 244.
- Take the square root: c = √244 = 2√61 ≈ 15.62 ft.
Finding a leg
A 13 m support cable runs from the top of a pole to a stake 5 m from its base. How tall is the pole?
- Square the hypotenuse and the known leg: 13² = 169 and 5² = 25.
- Subtract: 169 − 25 = 144.
- Take the square root: b = √144 = 12 m.
Always subtract when you’re finding a leg. Adding would give a side longer than the hypotenuse, which is impossible.
Common Pythagorean triples
| a | b | c | Notes |
|---|---|---|---|
| 3 | 4 | 5 | The classic carpenter’s triangle |
| 5 | 12 | 13 | |
| 8 | 15 | 17 | |
| 7 | 24 | 25 | |
| 20 | 21 | 29 | Legs almost equal |
| 6 | 8 | 10 | 2 × (3-4-5) |
| 9 | 12 | 15 | 3 × (3-4-5) |
| 1 | 1 | √2 ≈ 1.4142 | Square’s diagonal; not a triple |
| 1 | √3 ≈ 1.7321 | 2 | 30-60-90 triangle |
Memorizing the first few triples lets you spot whole-number answers instantly on tests.
Real-life uses
- Squaring a foundation or deck. Builders use the 3-4-5 rule to set out right-angled corners, and they compare the two diagonals of a rectangle: if they match, the corners are square. Once the layout is square, the square footage calculator gives the area.
- Ladder placement. A ladder’s length is the hypotenuse. Knowing how far the base sits from the wall tells you how high the top reaches.
- Screens. TV and monitor sizes are diagonal measurements, so the theorem links the advertised size to the width and height.
- Distances on a map or grid. The straight-line distance between two points is √(Δx² + Δy²). The slope calculator uses this to report the distance between two points.
- Sports. A baseball diamond is a 90 ft square, so the throw from home plate to second base is 90√2 ≈ 127.28 ft.
- Roof rafters. The rafter is the hypotenuse of a triangle formed by the rise and half the building’s width (the run).
Common mistakes
- Using the wrong side as c. The hypotenuse is always opposite the right angle and is the longest side. Plugging a leg into c gives nonsense.
- Adding instead of squaring. 3 + 4 = 7 isn’t the hypotenuse. You must square, add, then take the square root, which gives 5.
- Forgetting the square root. After adding the squares you have c², not c. The square root calculator finishes the job and simplifies the radical.
- Mixing units. Convert feet and inches to one unit before squaring. 5 ft 6 in is 5.5 ft, not 5.6 ft.
- Applying it to non-right triangles. For triangles without a 90° angle, use the law of cosines.
Glossary
- Right triangle: a triangle with one angle of exactly 90°.
- Leg: either of the two sides that form the right angle.
- Hypotenuse: the side opposite the right angle.
- Pythagorean triple: three whole numbers that satisfy a² + b² = c².
Worked examples
Diagonal of a TV screen
A TV screen is 48 in wide and 27 in tall. How long is its diagonal?
Inputs (Find the hypotenuse): Leg a = 48; Leg b = 27; Unit = Inches
c² = a² + b² = 48² + 27² = 2,304 + 729 = 3,033 c = √3,033 = 55.072679
Answer: Hypotenuse c: 3√337 ≈ 55.072679 in (legs 48 and 27, hypotenuse 55.072679).
How high a ladder reaches
A 16 ft ladder stands with its foot 4 ft from the wall. How high up the wall does it reach?
Inputs (Find a missing leg): Known leg = 4; Hypotenuse c = 16; Unit = Feet
b² = c² − a² = 16² − 4² = 256 − 16 = 240 b = √240 = 15.491933
Answer: Missing leg b: 4√15 ≈ 15.491933 ft (legs 4 and 15.491933, hypotenuse 16).
Leg from a 3-4-5 multiple
One leg is 20 and the hypotenuse is 25. Find the other leg.
Inputs (Find a missing leg): Known leg = 20; Hypotenuse c = 25; Unit = No unit
b² = c² − a² = 25² − 20² = 625 − 400 = 225 b = √225 = 15
Answer: Missing leg b: 15 (legs 20 and 15, hypotenuse 25).
Checking a corner for square
Edge case: a builder measures 12 ft and 35 ft along two walls and 37 ft across. Is the corner square?
Inputs (Check a right triangle): Side 1 = 12; Side 2 = 35; Side 3 = 37
Longest side c = 37; a² + b² = 12² + 35² = 1,369; c² = 37² = 1,369 a² + b² = c², so the triangle is a right triangle.
Answer: Sides 12, 35, 37: a right triangle.
Assumptions and limitations
- The theorem applies only to right triangles, which have one 90° angle. The third tab tests whether three sides form one.
- Side lengths must be greater than 0 and no more than 1,000,000,000. All sides use the same unit, which you choose from the list (or "No unit" for textbook problems).
- When finding a leg, the hypotenuse must be longer than the known leg.
- Results are rounded to 6 decimal places and angles to 4 decimal places in degrees. When the result is an irrational square root, the exact simplified form, such as 4√15, is shown too.
- The check tab treats the longest side as the possible hypotenuse, so you can enter the sides in any order. It allows a tiny tolerance (one part in a billion) for decimal rounding, and it also reports acute, obtuse or impossible triangles.
- Feet-and-inches values must be converted to a single unit first, such as 5 ft 6 in = 5.5 ft or 66 in.
Frequently asked questions
How do you find the hypotenuse?
Square both legs, add them and take the square root. With legs of 7 and 24, c = √(49 + 576) = √625 = 25. Choose the "Find the hypotenuse" tab and enter the two legs.
How do you find a missing leg when you know the hypotenuse?
Subtract the square of the known leg from the square of the hypotenuse, then take the square root. With a hypotenuse of 17 and a leg of 8, b = √(289 − 64) = √225 = 15. Use the "Find a missing leg" tab.
Can the Pythagorean theorem find angles?
Not by itself, but once you know all three sides, trigonometry gives the angles. The angle opposite leg a is arctan(a ÷ b). The calculator lists both acute angles. They always add up to 90°.
How do I use the Pythagorean theorem in construction?
To check that a corner is square, measure 3 ft along one wall and 4 ft along the other. The diagonal between the marks should be exactly 5 ft. For more accuracy on larger layouts, use multiples such as 6-8-10 or 9-12-15. Enter your three measurements in the "Check a right triangle" tab.
Does the Pythagorean theorem work for every triangle?
No, only for right triangles. If a² + b² is larger than c², the largest angle is acute (less than 90°). If it's smaller, that angle is obtuse. For non-right triangles, the law of cosines, c² = a² + b² − 2ab·cos C, generalizes the theorem.
What are Pythagorean triples?
Sets of three whole numbers that fit a² + b² = c² exactly, such as 3-4-5, 5-12-13, 8-15-17 and 7-24-25. Any multiple of a triple is also a triple, so 3-4-5 gives 6-8-10, 9-12-15 and so on.
How do I give an exact answer?
Leave the root in simplest radical form. Legs of 2 and 4 give c = √20 = 2√5. The calculator shows this exact value next to the decimal whenever the answer isn't a whole number.
Sources
- 9.3 Use Properties of Angles, Triangles, and the Pythagorean Theorem — Prealgebra 2e — OpenStax, Rice University. Checked October 10, 2026.
- Pythagorean Theorem — Wolfram MathWorld. Checked October 10, 2026.