Pythagorean Theorem Calculator
Solve a right triangle from any two sides. Find the missing side, area, perimeter, and angles — with special-triangle detection for classic Pythagorean triples.
A right triangle with legs 3 and 4 has a hypotenuse of 5. This is a classic 3-4-5 Pythagorean triple.
How to use this calculator
Choose what you want to solve for — the hypotenuse (c), or one of the two legs (a or b) — then enter the other two sides. The missing side is computed instantly, along with the area, the perimeter, and both acute angles. If your numbers match a classic Pythagorean triple or a 30-60-90 / 45-45-90 template, the calculator calls it out so you know you've landed on a well-known ratio.
The theorem in plain English
In any right triangle, the two shorter sides (the legs) and the longest side (the hypotenuse, opposite the right angle) are bound by a² + b² = c². That single equation has powered surveying, navigation, architecture, and computer graphics for 2,500 years. Given any two of the three sides, the formula solves for the remaining one — no measurement tool needed.
Solving for each side
Both legs known: c = √(a² + b²). This is the form most people learn first. One leg and the hypotenuse known:the other leg is √(c² − a²). That subtraction only makes sense when the leg is smaller than the hypotenuse — if it isn't, the inputs don't describe a real right triangle, and the calculator flags an error.
The special triangles worth memorising
3-4-5 is the gateway Pythagorean triple — every carpenter and surveyor keeps it close because a 3-4-5 ratio (scaled to any units) guarantees a perfect 90° corner with just a tape measure. 5-12-13, 8-15-17, and 7-24-25 are the next few primitive triples; each appears often enough in geometry problems that recognising them saves a calculation.
45-45-90 is the diagonal of a square — two equal legs, hypotenuse = leg × √2 ≈ 1.414 × leg. 30-60-90 is half of an equilateral triangle — sides in the ratio 1 : √3 : 2, so the hypotenuse is exactly twice the shortest leg, and the longer leg is about 1.732× the shortest.
Where you'll actually use this
Framing a wall and need to verify it's square? Measure 3 feet along one side, 4 feet along the other, and check that the diagonal is exactly 5 feet. Building a ramp? The theorem tells you the hypotenuse length given the run and rise. Laying out a garden bed, designing a staircase, computing straight-line distance between two map points, or sizing the diagonal of a TV screen — all one-step Pythagorean applications.
Limits and extensions
The theorem assumes flat (Euclidean) geometry. On a sphere or a curved surface, a² + b² = c² breaks down — which is why long-distance navigation uses spherical trigonometry instead. For any non-right triangle, the Law of Cosines generalises the Pythagorean theorem: c² = a² + b² − 2ab·cos(C), with the cos(C) term collapsing to zero exactly when C is 90°.
Frequently asked questions
What is the Pythagorean theorem?▾
For any right triangle, the square of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the other two sides: a² + b² = c². It only applies to right triangles — triangles with exactly one 90° angle. Given any two sides, you can solve for the third by rearranging the formula: c = √(a² + b²), or a = √(c² − b²) if you have the hypotenuse and one leg.
How do I know if my numbers form a Pythagorean triple?▾
A Pythagorean triple is three positive integers that satisfy a² + b² = c². The smallest is (3, 4, 5) — because 9 + 16 = 25. Other common triples are (5, 12, 13), (8, 15, 17), and (7, 24, 25). Any whole-number multiple of a triple is also a triple, so (6, 8, 10) and (30, 40, 50) work too. This calculator flags them automatically when they appear.
What are 45-45-90 and 30-60-90 triangles?▾
They're the two most common "special" right triangles in geometry. A 45-45-90 is an isoceles right triangle — both legs equal, and the hypotenuse is a leg times √2. A 30-60-90 has legs in the ratio 1 : √3, with a hypotenuse exactly twice the shortest leg. You'll see these ratios constantly in trigonometry and construction because they let you find side lengths without a calculator.
Why are the two acute angles different?▾
The three angles of any triangle always sum to 180°. In a right triangle, one angle is 90°, so the other two must add up to 90° and split that total between them. Whichever leg is longer sits opposite the larger acute angle. The calculator uses arctan to compute each: angle opposite a = arctan(a / b), and similarly for b.
What if I have the two legs and want the area?▾
Area of any right triangle is simply half the product of its two legs: area = (a × b) / 2. The hypotenuse isn't involved. This calculator shows both area and perimeter as soon as you've entered any two sides — the third side is solved automatically and plugged into the area or perimeter formula.
Does this work for non-right triangles?▾
No — the Pythagorean theorem only applies when one angle is exactly 90°. For other triangles, you'd use the Law of Cosines (c² = a² + b² − 2ab·cos(C)) which reduces to the Pythagorean theorem when C is 90° (because cos(90°) = 0). For a general triangle solver, you'd need side + angle combinations, which is a different tool.
Related calculators
Scientific Calculator
Full scientific calculator with trig, logs, exponents, factorials, and constants like π and e. Parse expressions as you type.
Simple Calculator
Fast, free online calculator for everyday math — add, subtract, multiply, divide, percentages, and square roots. Keyboard friendly.
Unit Converter
Convert length, weight, temperature, volume, area, and speed between metric and imperial units — fast and precise.