Home » Mathematics » Pythagorean Theorem Calculator

Pythagorean Theorem Calculator

Free Pythagorean theorem calculator. Solve for the hypotenuse or a missing leg of a right triangle, verify three sides, with area, angles, and triple matching.

FREE CALCULATOR
min 0, max 1000000000
min 0, max 1000000000
min 0, max 1000000000
🧮

Your results will appear here.
Enter your values and press Calculate.

How it works

Pick what to solve for: the hypotenuse c, leg a, or leg b, then enter the two sides you know. The hypotenuse comes from c = sqrt(a² + b²⁾; a missing leg rearranges the same equation to subtraction, a = sqrt(c² - b²⁾, which only works when the hypotenuse is longer than the known leg, as it must be in any real right triangle. The check mode sorts your three sides, treats the longest as the hypotenuse, and tests the converse: if a² + b² equals c² (within a small tolerance), the triangle is right-angled. Every mode also reports the area (a*b/2), the perimeter, both acute angles via arcsine, the altitude to the hypotenuse (a*b/c), and whether the sides match a known Pythagorean triple. Common Pythagorean triples such as 3-4-5, 5-12-13 and 8-15-17 let you check answers quickly. The distance formula in coordinate geometry is the same idea: the distance between two points is the hypotenuse of a right triangle, so you can find a missing leg or find the hypotenuse with the same steps.

a² + b² = c², c = sqrt(a² + b²⁾, a = sqrt(c² - b²⁾, b = sqrt(c² - a²⁾, area = a*b/2, perimeter = a + b + c, altitude to hypotenuse h = a*b/c, check: longest side² = sum of other two squares

The Pythagorean theorem, explained

In a right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: a² plus b² = c². In words: the hypotenuse squared equals the sum of the legs squared. The theorem is named for Pythagoras of Samos, though the relationship was known to earlier cultures too. The hypotenuse is the side opposite the 90-degree angle and is always the longest side; the legs are the two sides that form the right angle.

The classic 3-4-5 triangle shows it working: 3² + 4² = 9 + 16 = 25 = 5². The theorem only applies to right triangles. For acute or obtuse triangles, the Law of Cosines is the generalization you need.

Rearranged, the same equation solves for a missing leg: a = sqrt(c² - b²⁾. Note the subtraction: finding a leg removes a square instead of adding one, which is where most sign errors come from.

How to use this calculator

Choose the solve mode: Hypotenuse c, Leg a, Leg b, or Check right triangle. Enter the two sides you know (or all three for the check mode) using the same unit for every side.

The calculator returns the missing side plus the area, perimeter, both acute angles, the altitude to the hypotenuse, and whether your sides match a known Pythagorean triple. In check mode it tells you plainly whether the three sides form a right triangle.

If you ask for a leg but the supposed hypotenuse is not longer than the known leg, the calculator flags the impossible combination instead of computing a square root of a negative number.

The three rearrangements: hypotenuse, leg a, leg b

Finding the hypotenuse adds the squares: c = sqrt(a² + b²⁾. Legs 3 and 4 give sqrt(9 + 16) = 5; legs 7 and 9 give sqrt(130) = 11.40.

Finding a leg subtracts: a = sqrt(c² - b²⁾. With hypotenuse 13 and leg 5, a = sqrt(169 - 25) = sqrt(144) = 12. With hypotenuse 5 and leg 4, a = sqrt(25 - 16) = 3.

The same pattern gives leg b: b = sqrt(c² - a²⁾. With hypotenuse 10 and leg 6, b = sqrt(100 - 36) = 8. The hypotenuse must always be the longest side, so if your numbers say otherwise, recheck which side you labeled c.

The converse: checking whether three sides make a right triangle

The converse of the theorem: if three side lengths satisfy a² + b² = c², the triangle must contain a right angle. Sort the sides so the longest is c, then compare.

Sides 6, 8, 10: 36 + 64 = 100 = 10², so yes, right triangle. Sides 5, 6, 8: 25 + 36 = 61, but 8² = 64, so no.

The comparison generalizes nicely: if c² < a² + b² the triangle is acute, and if c² > a² + b² it is obtuse. That is how you classify any triangle from its sides alone.

Pythagorean triples and special right triangles

A Pythagorean triple is a set of positive integers satisfying a² + b² = c². The famous ones: 3-4-5, 5-12-13, 8-15-17, 7-24-25, 9-40-41, and 20-21-29. Multiples work too: 6-8-10 is just twice 3-4-5.

Builders know 3-4-5 as the 3-4-5 rule: mark 3 and 4 units along two edges, and the diagonal is exactly 5 only if the corner is square. It is the fastest square check on a job site.

Two special triangles appear constantly. The 45-45-90 isosceles right triangle has sides in the ratio 1:1:sqrt(2); legs of 10 give a hypotenuse of 14.14. The 30-60-90 triangle has sides 1:sqrt(3):2; the short leg is half the hypotenuse.

Where the theorem is used: ladders, construction, diagonals

Construction and carpentry: checking that corners are square, laying out foundations, and computing diagonal bracing. The 3-4-5 rule turns the theorem into a tape-measure test.

Ladder problems: a 13-foot ladder reaching 12 feet up a wall stands sqrt(169 - 144) = 5 feet from the wall. The ladder is the hypotenuse, the wall and ground are the legs.

Room and box diagonals: the diagonal of a rectangle, or through a 3D box with d = sqrt(x² + y² + z²⁾, which is the theorem applied twice.

Ramps, cables, and braces: any straight-line distance between a horizontal and a vertical measurement is a hypotenuse. Ramp length is another hypotenuse in disguise: from the rise and the run, length = sqrt(rise² + run²⁾. Navigation and surveying use the same idea for shortest paths, and game programmers use it for distances between objects.

Common mistakes to avoid

These are the most common mistakes beginners make with the theorem, and each one is easy to prevent once you see the pattern.

Using the wrong side as the hypotenuse: c is always opposite the right angle and always the longest side. Substituting a leg for c breaks every rearrangement.

Forgetting to square: use a² and b², not a + b. Adding the legs gives a longer number than the hypotenuse, which is a quick sanity check.

Applying the theorem to a non-right triangle: the standard equation is right-triangles only. Acute and obtuse triangles need the Law of Cosines.

Mixing units: convert everything to one unit first. A leg in inches and a hypotenuse in feet will silently give a wrong answer.

Entering an impossible combination: the hypotenuse must be longer than either leg. If it is not, no right triangle exists with those numbers.

Worked examples: 3-4-5 and the ladder problem

Finding the hypotenuse: legs a = 3, b = 4. c = sqrt(3² + 4²⁾ = sqrt(9 + 16) = sqrt(25) = 5. Area = 3*4/2 = 6, perimeter = 12, and the acute angles are arcsin(3/5) = 36.87 degrees and 53.13 degrees.

Finding a leg: hypotenuse 13, leg 5. a = sqrt(13² - 5²⁾ = sqrt(169 - 25) = sqrt(144) = 12.

The ladder problem: a 13-foot ladder leans against a wall, reaching 12 feet high. How far is the base from the wall? Ladder word problems follow one pattern: the ladder is the hypotenuse, the wall and ground are the legs, so base = sqrt(13² - 12²⁾ = sqrt(169 - 144) = sqrt(25) = 5 feet.

Checking sides: do 7, 24, 25 form a right triangle? 7² + 24² = 49 + 576 = 625 = 25². Yes.

Frequently asked questions

In a right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c², where a and b are the legs and c is the hypotenuse.

The side opposite the 90-degree right angle. It is always the longest side of a right triangle, longer than either leg.

Either of the two shorter sides that meet at the right angle. The legs are the sides you square and add (or subtract) in the formula.

No, only for right triangles, those with exactly one 90-degree angle. For acute or obtuse triangles, use the Law of Cosines instead.

Square both legs, add them, and take the square root: c = sqrt(a² + b²⁾. Legs 3 and 4 give sqrt(9 + 16) = 5.

Subtract instead of adding: a = sqrt(c² - b²⁾. With hypotenuse 13 and leg 5: sqrt(169 - 25) = 12. This only works when the hypotenuse is longer than the known leg.

Sort the sides so the longest is c, then test the converse: if a² + b² = c², it is a right triangle. Sides 6, 8, 10 pass (36 + 64 = 100); sides 5, 6, 8 fail (61 vs 64).

Sets of three positive integers satisfying a² + b² = c², like 3-4-5, 5-12-13, 8-15-17, 7-24-25, and 9-40-41. Multiples count too: 6-8-10 is twice 3-4-5.

A tape-measure test for square corners: mark 3 and 4 units along two edges meeting at a corner. If the diagonal between the marks is exactly 5, the corner is a true right angle.

Never. The hypotenuse is always the longest side. If your numbers say otherwise, you have mislabeled the sides or the combination is impossible, and the calculator will flag it.

Any unit, as long as every side uses the same one. Mixing inches and feet is one of the most common sources of wrong answers.

Half the product of the legs: A = a*b/2. A 3-4-5 triangle has area 6. The altitude to the hypotenuse is a*b/c, which is 2.4 for the 3-4-5 triangle.

Special right triangles with fixed side ratios. 45-45-90 (isosceles right): 1:1:sqrt(2). 30-60-90: 1:sqrt(3):2, where the short leg is half the hypotenuse.

Related calculators