Pythagorean Theorem Calculator
Solve a² + b² = c² for any side of a right triangle, with area, perimeter and angles shown alongside.
Hypotenuse (c)
5
- Leg a
- 3
- Leg b
- 4
- Hypotenuse c
- 5
- Area
- 6
- Perimeter
- 12
- Angle opposite a (°)
- 36.87
- Angle opposite b (°)
- 53.13
For any right triangle, a² + b² = c² (Euclid, Elements I.47). Given two sides the third is fixed; angles follow from sin⁻¹(leg ÷ hypotenuse). Units are whatever you put in — the formula is scale-free.
How to use this calculator
Pick which side you want to solve for — the hypotenuse (the longest side, opposite the right angle) or one of the two legs. Enter the two sides you already know in the units of your choice; centimetres, metres, inches, feet, or just plain numbers all work because the formula is scale-free. The calculator returns the missing side along with the triangle's area, perimeter and the two non-right angles. If you are solving for a leg, the hypotenuse must be the longer of the two values you enter.
How the calculation works
In any right triangle the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c² (Euclid, Elements, Book I, Proposition 47). Solving for the hypotenuse gives c = √(a² + b²); solving for a leg rearranges to a = √(c² − b²). Once all three sides are known, the area follows from ½·a·b (legs are perpendicular), the perimeter from a + b + c, and the non-right angles from sin⁻¹(leg ÷ hypotenuse). The right angle is always 90° so the remaining two angles sum to 90° as well.
Worked example
The classic 3-4-5 triangle: with legs a = 3 and b = 4, c = √(9 + 16) = √25 = 5. Area = ½ × 3 × 4 = 6, perimeter = 12. Angle opposite leg a = sin⁻¹(3/5) ≈ 36.87°, angle opposite leg b ≈ 53.13°, and 36.87 + 53.13 + 90 = 180 as expected. Try a = 5, b = 12 and you should see c = 13; try a = 8, b = 15 and you should see c = 17. These are all Pythagorean triples — integer right triangles known since antiquity.
Frequently asked questions
What is the Pythagorean theorem?
The Pythagorean theorem states that in a right triangle the area of the square on the hypotenuse equals the sum of the areas of the squares on the other two sides — written algebraically as a² + b² = c², where c is the hypotenuse. It was known to Babylonian mathematicians a thousand years before Pythagoras and proved geometrically by Euclid in Book I, Proposition 47 of the Elements. There are now hundreds of distinct proofs, including a famous one by US President James Garfield.
Does the theorem work for any triangle?
No. It only holds for right triangles — triangles with one 90° angle. The two sides meeting at the right angle are the legs, and the side opposite is the hypotenuse. For non-right triangles you need the more general law of cosines, c² = a² + b² − 2ab·cos(C), which reduces to a² + b² = c² when the angle C is 90° because cos(90°) = 0.
How do I know which side is the hypotenuse?
The hypotenuse is always the longest side of a right triangle and it is always opposite the right angle. If you label the right-angle corner C, then side c (running from corner A to corner B, opposite C) is the hypotenuse. The two legs a and b are the sides that meet at the right angle. When solving for a leg, your given hypotenuse must be longer than your given leg — otherwise no real triangle exists.
What is a Pythagorean triple?
A Pythagorean triple is a set of three positive integers (a, b, c) that satisfy a² + b² = c². The smallest is (3, 4, 5); other primitive triples include (5, 12, 13), (8, 15, 17), (7, 24, 25) and (20, 21, 29). Every integer multiple of a primitive triple is also a Pythagorean triple. Triples are useful for quick mental geometry checks and for setting out right angles on building sites — measure 3 and 4 along two intersecting strings and the diagonal will be exactly 5 only when the strings meet at 90°.
Can I use negative or zero side lengths?
No. A triangle has three strictly positive sides, so the calculator rejects zero or negative inputs. When solving for a leg, the hypotenuse must also be strictly greater than the known leg; if it is equal the triangle is degenerate (a line segment) and if it is smaller the formula returns the square root of a negative number, which is not a real length.
How are the angles calculated?
Once all three side lengths are known, each non-right angle follows from inverse trigonometry on the right-triangle ratios. The angle opposite leg a equals sin⁻¹(a / c) — that is, the arcsine of the leg divided by the hypotenuse. Equivalently you could use cos⁻¹(b / c) or tan⁻¹(a / b). The two non-right angles always sum to 90° because the interior angles of any triangle sum to 180° and one of them is fixed at 90°.