The Pythagorean theorem says that in every right triangle the two legs and the hypotenuse obey a² + b² = c², where c is the side opposite the 90° angle. Give this calculator any two of the three sides and it returns the third, as a decimal and, for whole-number inputs, in exact simplified radical form. It also reports both acute angles, the area, the perimeter and the height dropped onto the hypotenuse.
How to use the Pythagorean theorem calculator
- Under Solve for, choose Hypotenuse c, Leg a or Leg b.
- Enter the two sides that remain visible. The hypotenuse is always the longest side, so when you solve for a leg, c must be larger than the leg you enter.
- Pick the Units, from millimeters to miles. All three sides share the same unit.
- Read the answer at the top of the tape. If your inputs are whole numbers and the answer is irrational, an exact value such as 2√13 appears beneath it, and a note flags any Pythagorean triple.
Pythagorean theorem formulas
Rearranged for each unknown side:
The extra results come from the same three sides: area = ½ab, angle A = arctan(a ÷ b), and height to the hypotenuse = ab ÷ c.
Worked example: squaring a shed foundation
You are forming a 12 ft × 16 ft shed slab and want every corner at exactly 90°. Treat the two walls as legs: a = 12 ft and b = 16 ft.
- c = √(12² + 16²) = √(144 + 256) = √400 = 20 ft.
- Measure both diagonals of the form. When each reads 20 ft, all four corners are square.
- If one diagonal is longer than the other, the form is racked out of square; push along the long diagonal until both match.
Working backward: a 20 ft guy wire anchored 12 ft from the base of a pole reaches √(20² − 12²) = 16 ft up the pole.
On site, builders use the 3-4-5 method: mark 3 ft along one string line and 4 ft along the other, then swing the lines until the two marks are exactly 5 ft apart. For long walls, scale up to 6-8-10 or 9-12-15; an eighth-inch measuring slip matters less over a bigger triangle.
Common Pythagorean triples
A Pythagorean triple is three whole numbers that fit the theorem exactly. Euclid’s formula produces them: choose whole numbers m > n, then a = m² − n², b = 2mn and c = m² + n².
| m, n | Legs | Hypotenuse | Smaller acute angle |
|---|---|---|---|
| 2, 1 | 3, 4 | 5 | 36.87° |
| 3, 2 | 5, 12 | 13 | 22.62° |
| 4, 1 | 15, 8 | 17 | 28.07° |
| 4, 3 | 7, 24 | 25 | 16.26° |
| 5, 2 | 21, 20 | 29 | 43.60° |
| 5, 4 | 9, 40 | 41 | 12.68° |
| 6, 1 | 35, 12 | 37 | 18.92° |
Any whole-number multiple of a triple is also a triple, so 6-8-10 and 10-24-26 work too.
The converse: testing for a right angle
The theorem also runs in reverse. If three lengths satisfy a² + b² = c², with c the longest, the angle opposite c is exactly 90°. If a² + b² is larger than c², all three angles are acute; if it is smaller, the triangle is obtuse. For sides 7, 8 and 11, 49 + 64 = 113 is less than 121, so that triangle has an obtuse angle. To find the actual angles of a triangle without a right angle, use the triangle calculator or the law of cosines calculator.
Exact answers and simplified radicals
Most hypotenuses are irrational. With legs 4 and 6, c² = 52, and √52 = √(4 × 13) = 2√13 ≈ 7.2111. The calculator pulls out the largest perfect-square factor for you, which is what homework means by “exact form.” Decimal inputs such as 4.5 give a decimal answer only.
Common mistakes
- Adding before squaring. √(a² + b²) is not a + b: legs of 3 and 4 give 5, not 7.
- Mislabeling the hypotenuse. It is always opposite the right angle and always the longest side.
- Mixing units. Convert inches to feet (or the reverse) before entering; the length converter helps.
A short history
Babylonian scribes listed large triples on the clay tablet known as Plimpton 322 around 1800 BCE, more than a thousand years before Pythagoras. The oldest surviving Greek proof is Proposition 47 in Book I of Euclid’s Elements. The same relationship powers the distance calculator: the gap between two points is the hypotenuse of a right triangle whose legs are the differences in x and y.
Frequently asked questions
What is the Pythagorean theorem?
In a right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c². With legs of 3 and 4, the hypotenuse is √(9 + 16) = √25 = 5.
How do I find a leg when I know the hypotenuse?
Subtract the square of the known leg from the square of the hypotenuse, then take the square root. With c = 20 and b = 12, a = √(400 − 144) = √256 = 16. The hypotenuse must be longer than the leg, or no right triangle exists.
Does the Pythagorean theorem work for every triangle?
No. It holds only when one angle is exactly 90°. For other triangles use the law of cosines, c² = a² + b² − 2ab cos C, which turns back into the Pythagorean theorem when C is 90° because cos 90° = 0.
How does the 3-4-5 rule square a corner?
A triangle with sides 3, 4 and 5 always has a right angle between the 3 and 4 sides, because 9 + 16 = 25. Mark 3 units along one line and 4 along the other, then adjust until the marks are exactly 5 units apart. Multiples such as 6-8-10 work the same way.
Why does the answer show a value like 2√13?
When you enter whole numbers and the result is not a whole number, the calculator also gives the exact simplified radical. Legs of 4 and 6 give c = √52 = 2√13, about 7.2111. Decimal inputs show only the decimal answer.