Skip to content

Pythagorean Theorem Calculator

A right triangle with legs of 3 and 4 has a hypotenuse of 5, because 3² + 4² = 9 + 16 = 25 = 5². Enter any two sides to find the third, or all three to check for a right angle.

a and b are the legs that meet at the right angle; c is the hypotenuse across from it, always the longest side.

Hypotenuse c

5 ft

Angles
α 36.87° (36°52′12″) · β 53.13° · 90°
Area
6 ft²
Perimeter
12 ft
Height to the hypotenuse
2.4 ft
Inradius · circumradius
1 · 2.5 ft
Pythagorean triple
3-4-5
How it’s calculated
  1. Hypotenuse c√(3² + 4²) = √25 = 5 ft
  2. Angle α (opposite a)atan(3 ÷ 4) = 36.87°
  3. Area3 × 4 ÷ 2 = 6 ft²

Updates as you typeNo sign-upShare the link and your numbers travel with it

The theorem and its three forms

To find Formula Example
Hypotenuse c c = √(a² + b²) a 3, b 4 → c = 5
Leg a a = √(c² − b²) b 12, c 13 → a = 5
Leg b b = √(c² − a²) a 5, c 13 → b = 12

The legs a and b meet at the right angle; the hypotenuse c is opposite it and is always the longest side. If you try to find a leg with a “hypotenuse” shorter than the other leg, there is no such triangle, and the calculator says so. Besides the missing side, the result gives both acute angles (α opposite a, β opposite b), the area ab ÷ 2, the perimeter and the height from the right angle to the hypotenuse, ab ÷ c.

Exact roots and Pythagorean triples

When a² + b² is a perfect square, the sides are whole numbers — a Pythagorean triple. The best known are 3-4-5, 5-12-13, 8-15-17 and 7-24-25, and any multiple works: 7.5-10-12.5 is 2.5 times 3-4-5, which the result points out. Otherwise the hypotenuse is a square root that never ends, so the calculator also shows the exact form for math homework: legs of 1 and 1 give √2, legs of 10 and 10 give 10√2. A 48 × 27-inch TV screen has a diagonal of √3033 = 3√337 ≈ 55.07 inches, which is why it is sold as a 55-inch set.

From one side and an angle

When you know one side and one of the acute angles instead of two sides, trigonometry finishes the triangle. With α the angle opposite leg a: c = a ÷ sin α, b = a ÷ tan α; from leg b, c = b ÷ cos α and a = b × tan α; from the hypotenuse, a = c × sin α and b = c × cos α. A ramp 12 ft long rising at 5° climbs 12 × sin 5° = 1.05 ft and covers 12 × cos 5° = 11.95 ft of floor. Choose All sides, from one side and an angle to get every side, both angles, the area and the perimeter.

Squaring a corner: the 3-4-5 rule

Builders lay out square corners for foundations, decks, patios and tile with the theorem. From the corner, mark 3 feet along one side and 4 feet along the other; the diagonal between the marks should be exactly 5 feet. For larger layouts use 6-8-10 or 9-12-15 to reduce the error. Or measure the two sides of any rectangle and compare the diagonal with √(length² + width²): a 12 × 15-foot room should measure 19.21 feet corner to corner, and the two diagonals should match. Use Check with three measurements to see how far a corner is off — 6, 8 and 10.2 feet make an angle of 92.4°, not 90°. For lengths in feet and inches, add and subtract them first with the feet and inches calculator.

Ladders, ramps and roofs

  • Ladders: OSHA’s rule puts the base about one quarter of the working length out from the wall. A 12-foot ladder with its base 3 feet out reaches √(144 − 9) = 11.62 feet up.
  • Ramps: a ramp that rises 30 inches over a 360-inch run is a 1:12 slope, and its surface is √(30² + 360²) = 361.2 inches, about 30.1 feet long.
  • Roof rafters: a 6-in-12 roof rises 6 inches for every 12 of run, so each foot of run needs √(6² + 12²) = 13.42 inches of rafter.

For the area of the floor or the roof those triangles sit on, see the square footage calculator.

Why it works

Draw squares on each side of a right triangle. The two smaller squares together have exactly the area of the large one on the hypotenuse — the statement a² + b² = c². The theorem is named after Pythagoras, but Babylonian clay tablets list triples centuries earlier, and there are hundreds of proofs. It also gives the distance between two points on a map or a graph: √((x₂ − x₁)² + (y₂ − y₁)²). For squares and roots on their own, use the scientific calculator.

Frequently asked questions

What is the Pythagorean theorem?

In a right triangle, the squares of the two legs add up to the square of the hypotenuse: a² + b² = c². The hypotenuse is the side across from the right angle and is always the longest.

How do I find the hypotenuse?

Square both legs, add them and take the square root: c = √(a² + b²). Legs of 5 and 12 give √169 = 13.

How do I find a missing leg?

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

What is the 3-4-5 rule in construction?

Measure 3 units along one line and 4 along the other from the corner; if the diagonal between the marks is exactly 5, the corner is square. Multiples work too: 6-8-10 or 9-12-15 feet.

Why is the answer sometimes a square root like √2?

When a² + b² is not a perfect square, the hypotenuse is irrational. The calculator gives both the exact form, such as √2 or 10√2, and the decimal, 1.41421 or 14.1421.

Can I use the theorem on a triangle without a right angle?

No. For other triangles, use the law of cosines. The Check mode tells you whether three sides form a right angle and, if not, what the angle opposite the longest side is.