CalcFolio

Pythagorean Theorem Calculator

Know two sides of a right triangle? This Pythagorean theorem calculator finds the third, whether it's the hypotenuse or one of the legs, and shows the substitution step by step. It also returns both acute angles, the area, the perimeter and the height to the hypotenuse, and tells you when your three sides form a Pythagorean triple such as 3-4-5.

Updated

Solve for

Any length unit, the same for all sides

Same unit as the other side

Longest side, opposite the right angle

How to use the calculator

  1. Choose what to solve for: the hypotenuse c (the longest side, opposite the right angle) or a leg a or b (the two sides that form the right angle).
  2. Enter the two sides you know. Use any length unit, as long as both sides use the same one; the answer comes out in that unit.
  3. Read the missing side and the formula line, which shows the numbers substituted into the theorem.

When you solve for a leg, the hypotenuse must be longer than the leg you enter, otherwise no right triangle exists and the calculator shows an error.

The theorem and the formulas

In a right triangle the square of the hypotenuse equals the sum of the squares of the legs: a² + b² = c². Rearranged for each unknown:

  • c = √(a² + b²)
  • a = √(c² − b²)
  • b = √(c² − a²)

Once all three sides are known, the calculator adds:

  • Angle A (opposite leg a) = arctan(a ÷ b), and angle B = 90° − A. The third angle is the right angle.
  • Area = a × b ÷ 2 and perimeter = a + b + c.
  • Height to the hypotenuse = a × b ÷ c, the perpendicular distance from the right-angle corner to side c.

A Pythagorean triple is reported when all three sides come out as whole numbers. It's primitive when the sides share no common factor (3-4-5, 5-12-13, 8-15-17) and a multiple otherwise. Decimal sides such as 1.5-2-2.5 are a scaled 3-4-5 but aren't reported as a triple.

The theorem also works in reverse: if a² + b² = c² for three side lengths, the angle between a and b is a right angle. For triangles without a right angle, use the triangle calculator, which applies the law of cosines.

Worked examples

1. Squaring a deck corner with 3-4-5

Mark 6 ft along one rim joist and 8 ft along the other. The diagonal between the marks should be: c = √(6² + 8²) = √100 = 10 ft. The calculator labels it 6-8-10 = 2 × (3-4-5). If your tape reads more than 10 ft the corner is open past 90°; less, and it's closed. Larger layouts give a more precise check:

LegsDiagonalTriple
3 ft and 4 ft5 ft3-4-5 (primitive)
9 ft and 12 ft15 ft3 × (3-4-5)
12 ft and 16 ft20 ft4 × (3-4-5)

2. How high does a 12-foot ladder reach?

OSHA's construction ladder rule (29 CFR 1926.1053) asks that a non-self-supporting ladder be set so the horizontal distance from the top support to its foot is about one-quarter of its working length. For a 12-ft working length that's 3 ft out. Solve for the leg: a = √(12² − 3²) = √135 = 11.618950 ft up the wall, at an angle of 75.522488° to the ground.

3. Screen diagonal

A screen that measures 48 by 27 inches has a diagonal of √3033 = 55.072679 in, about 55 inches. Its area is 648 in².

Reading the results

The hypotenuse is always the longest side, so a result for c that's shorter than a leg means the inputs were entered in the wrong fields. The two acute angles always add up to 90°. Results are rounded for display; when a side is irrational, such as √2 = 1.414214 for legs of 1 and 1, keep the radical form if your class asks for an exact answer.

Frequently asked questions

What is the Pythagorean theorem?

For any right triangle with legs a and b and hypotenuse c, a² + b² = c². With legs 3 and 4: 9 + 16 = 25, so the hypotenuse is 5.

How do I find a missing leg?

Subtract the square of the known leg from the square of the hypotenuse and take the square root. With c = 13 and a = 5: b = √(169 − 25) = √144 = 12, the primitive triple 5-12-13.

Does it work for triangles that aren't right triangles?

No. The theorem only holds when one angle is exactly 90°. For any other triangle, the triangle calculator solves it from three sides, two sides and an angle, or two angles and a side.

Why does the 3-4-5 method square a corner?

Because the theorem works in reverse: if the sides measure 3, 4 and 5 (or any multiple), 3² + 4² = 5² and the angle between the two shorter sides must be 90°. That's why a tape measure is all you need to check a corner.

What is a Pythagorean triple?

Three positive whole numbers that satisfy a² + b² = c². Primitive triples share no common factor; multiplying one by any whole number gives another triple, like 9-12-15 from 3-4-5.

Why do I get an error when solving for a leg?

The hypotenuse you entered is equal to or shorter than the known leg. Since c must be the longest side, c² − a² would be zero or negative and has no real square root.

Sources

  1. Wolfram MathWorld — Pythagorean Triple
  2. Wolfram MathWorld — Law of Cosines
  3. OSHA — 29 CFR 1926.1053, Ladders

Results are computed in floating-point arithmetic and rounded for display. For ladder setup and other safety-critical work, follow the manufacturer's instructions and the rules that apply to you.