Math & School

Pythagorean Theorem Calculator — Solve a, b or the Hypotenuse c

Solve any right triangle from two known sides with a² + b² = c²

The Pythagorean theorem is the single most useful rule in geometry, and it works for exactly one kind of triangle: a right triangle, the kind with a 90° corner. It says that the square of the longest side — the hypotenuse, labeled c, which always sits opposite the right angle — equals the sum of the squares of the other two sides, the legs a and b. In symbols that's the famous a² + b² = c², attributed to the Greek mathematician Pythagoras around 500 BC, though the relationship was used by Babylonian and Egyptian builders centuries earlier.

Because the equation links all three sides, knowing any two lets you solve for the third. This calculator handles all three cases:

  • Find the hypotenuse when you know both legs: c = √(a² + b²). With legs 3 and 4, c = √(9 + 16) = √25 = 5.
  • Find a missing leg when you know one leg and the hypotenuse: a = √(c² − b²). With c = 13 and b = 12, a = √(169 − 144) = √25 = 5.

The leg formula has one hard rule: the hypotenuse must be the longest side. If you try to solve for a leg but feed in a hypotenuse that's shorter than the other leg, the math asks for the square root of a negative number — which has no real answer and means the triangle can't exist. This calculator checks for that and tells you instead of returning nonsense.

A few Pythagorean triples — whole-number side sets that satisfy the theorem exactly — are worth memorizing because they show up constantly in textbooks and tests: 3-4-5, 5-12-13, 8-15-17, and 7-24-25, plus every multiple like 6-8-10 or 9-12-15. If two of your sides match a triple, the third is a clean whole number.

The theorem powers far more than homework. Carpenters use the 3-4-5 method to square up walls and decks; the distance between two points on a map or screen is just the hypotenuse of a right triangle (the distance formula is the Pythagorean theorem); navigation, construction, computer graphics and physics all lean on it. This tool also reports the triangle's area, perimeter and the two acute angles, so you get the full picture of the right triangle from just two measurements.

Easy ⏱ 5 min Updated: 2026-06-19 ✍️ By Jeferson Bruno
📖 See also: The Quadratic Formula, Explained Step by Step

Calculator

Fill in the fields and click "Calculate" for instant results.

Pick the side you don't know. Then fill in the other two.
One of the two short sides that meet at the right angle. Leave blank if you're solving for a.
The other short side that meets the right angle. Leave blank if you're solving for b.
The longest side, opposite the 90° angle. Leave blank if you're solving for c.
Number of decimal places shown in the answer.
Result
Waiting for calculation
Fill in the fields and click "Calculate".
Transparency: below the form you'll find an explanation, formula, examples, tips, and FAQ (when available for this calculator).

📰 Formula

• The theorem (right triangles only): a² + b² = c²  (c is the hypotenuse, opposite the 90° angle)
• Solve the hypotenuse: c = √(a² + b²)
• Solve a leg: a = √(c² − b²)   or   b = √(c² − a²)
• Validity rule: the hypotenuse c must be the largest side, so c² − leg² must be ≥ 0
• Area = (a × b) / 2   ·   Perimeter = a + b + c
• Acute angles: angle opposite a = arctan(a / b); the two acute angles sum to 90°

📰 Formula

• The theorem (right triangles only): a² + b² = c²  (c is the hypotenuse, opposite the 90° angle)
• Solve the hypotenuse: c = √(a² + b²)
• Solve a leg: a = √(c² − b²)   or   b = √(c² − a²)
• Validity rule: the hypotenuse c must be the largest side, so c² − leg² must be ≥ 0
• Area = (a × b) / 2   ·   Perimeter = a + b + c
• Acute angles: angle opposite a = arctan(a / b); the two acute angles sum to 90°

🧪 Worked examples

1

Example 1

2

Example 2

3

Example 3

4

Example 4

⚠️ Common mistakes

  • Applying the theorem to a triangle that isn't right-angled — a² + b² = c² only holds when there's a 90° angle.
  • Treating a leg as the hypotenuse: c is always the longest side and sits opposite the right angle.
  • Adding the sides instead of their squares (3 + 4 = 7 is wrong; √(3² + 4²) = 5 is right).
  • Forgetting the square root at the end, so you report c² instead of c.
  • Trying to find a leg with a hypotenuse that's shorter than the known leg — that triangle can't exist.

💡 Tips

  • The hypotenuse is always the longest side and always opposite the right angle — label it c before you start.
  • Memorize 3-4-5, 5-12-13, 8-15-17 and 7-24-25; their multiples (like 6-8-10) are right triangles too.
  • To square a corner in construction, mark 3 ft on one side, 4 ft on the other, and adjust until the diagonal reads exactly 5 ft.
  • The distance between two points (x₁,y₁) and (x₂,y₂) is √[(x₂−x₁)² + (y₂−y₁)²] — the same theorem.
  • Keep all three sides in the same unit; mixing feet and inches gives a wrong hypotenuse.

Embed this calculator on your site

Copy the code below and paste it into the HTML of your site or blog.

<iframe src="https://www.calcnimbus.com/embed/pythagorean-theorem-calculator" width="100%" height="500" frameborder="0" style="border:1px solid #eee;border-radius:12px"></iframe>

❓ Frequently asked questions

What is the Pythagorean theorem?

It states that in a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides: a² + b² = c². It only applies to triangles that contain a 90° angle.

How do I find the hypotenuse of a right triangle?

Square both legs, add them, then take the square root: c = √(a² + b²). For legs 3 and 4, c = √(9 + 16) = √25 = 5.

How do I find a missing leg when I know the hypotenuse?

Subtract the known leg's square from the hypotenuse's square, then take the square root: a = √(c² − b²). For c = 13 and b = 12, a = √(169 − 144) = √25 = 5.

Which side is the hypotenuse?

The hypotenuse is the side opposite the right angle, and it's always the longest side of the triangle. The two shorter sides that form the right angle are called the legs.

What are Pythagorean triples?

They are sets of three whole numbers that satisfy a² + b² = c² exactly, such as 3-4-5, 5-12-13, 8-15-17 and 7-24-25. Any multiple of a triple, like 6-8-10, is also a Pythagorean triple.

Does the Pythagorean theorem work for all triangles?

No. It only works for right triangles — those with a 90° angle. For triangles without a right angle you need the law of cosines, which generalizes the theorem to c² = a² + b² − 2ab·cos(C).

Why does my leg calculation give an error?

If you're solving for a leg, the hypotenuse must be larger than the other known leg. If it isn't, c² − b² is negative and has no real square root, which means no right triangle can have those measurements.

How is the Pythagorean theorem used in real life?

Carpenters use the 3-4-5 method to square corners, surveyors and navigators measure straight-line distances, and the distance formula in coordinate geometry is the theorem in disguise. It's also built into computer graphics, physics and construction.

Can the answer be a decimal instead of a whole number?

Yes. Whole-number results only happen with Pythagorean triples. Most real measurements give an irrational hypotenuse — for example a unit square's diagonal is √2 ≈ 1.4142 — so a decimal answer is perfectly normal.