Pythagorean Theorem Calculator

Pythagorean Theorem Calculator

Enter any two sides of a right triangle to calculate the missing side using the Pythagorean theorem. You can also enter all three sides to check whether they form a right triangle.

Geometry
How it works: Leave the side you want to find empty. Side c is the hypotenuse and must be the longest side.
One leg of the right triangle
The other leg
Hypotenuse, opposite the right angle
The calculation works with any consistent unit.
Result
c = 5
c = √(3² + 4²) = √25 = 5

What the Result Means

For a right triangle, the two shorter sides are called the legs, labeled a and b. The longest side, c, is the hypotenuse. It sits opposite the 90° angle.

If you enter two sides, the calculator solves for the third. If you enter all three, it compares a² + b² with c² and tells you whether the measurements satisfy the Pythagorean theorem.

Pythagorean Theorem Formula

a² + b² = c²

When both legs are known, solve for the hypotenuse:

c = √(a² + b²)

When the hypotenuse and one leg are known, rearrange the equation:

a = √(c² − b²)
b = √(c² − a²)

The subtraction formulas only work when c is longer than the known leg. A hypotenuse that is equal to or shorter than a leg cannot form a non-degenerate right triangle.

How to Use the Calculator

  1. Enter the lengths of any two known sides.
  2. Leave the side you want to calculate empty.
  3. Make sure c represents the hypotenuse.
  4. Select how many decimal places you want in the result.
  5. Add an optional unit such as cm, m, ft, or in.
  6. Press Calculate to see the missing side and the calculation steps.

If all three fields contain values, the tool switches to a right-triangle check instead of solving for a missing side.

Worked Example: Find the Hypotenuse

Suppose a right triangle has legs measuring 6 and 8.

c = √(6² + 8²)
c = √(36 + 64)
c = √100
c = 10

The hypotenuse is 10 units long. The values 6, 8, and 10 are a scaled version of the familiar 3-4-5 right triangle.

Worked Example: Find a Missing Leg

Suppose the hypotenuse is 13 and one leg is 5. To find the other leg:

b = √(13² − 5²)
b = √(169 − 25)
b = √144
b = 12

Common Pythagorean Triples

A Pythagorean triple is a set of whole-number side lengths that satisfies a² + b² = c².

Side aSide bHypotenuse c
345
51213
72425
81517
94041
123537

Multiples of a triple also work. For example, doubling 3-4-5 gives the right triangle 6-8-10.

Where the Pythagorean Theorem Is Used

  • Geometry: finding a missing side of a right triangle.
  • Distance problems: calculating a straight-line distance from horizontal and vertical offsets.
  • Construction: checking rectangular layouts and diagonal measurements.
  • Coordinate geometry: deriving distance between points on a coordinate plane.
  • Education: checking homework calculations and studying square roots.

For measurements in different units, convert them to the same unit before using the formula. The Length Converter can help with that step.

Common Input Mistakes

  • Using c for a shorter side: c must represent the hypotenuse.
  • Mixing units: do not combine values such as 3 meters and 4 feet without converting one first.
  • Entering zero or negative values: triangle side lengths must be greater than zero.
  • Using three arbitrary sides: not every set of three positive lengths forms a right triangle.
  • Rounding too early: keep the full square-root value during the calculation, then round the final result.

Calculator Limits

This calculator applies the Pythagorean theorem only to right triangles. It does not solve general triangles that lack a 90° angle. Calculations use standard JavaScript floating-point arithmetic, so very large values or values with many decimal places can have tiny rounding differences.

The selected decimal setting controls the displayed result. Internal calculations are performed before that display rounding is applied.

Frequently Asked Questions

Can I find the hypotenuse with this calculator?

Yes. Enter side a and side b, leave c empty, and press Calculate. The tool uses c = √(a² + b²).

Can I calculate a missing leg?

Yes. Enter the hypotenuse c and one known leg. Leave the other leg empty. The calculator subtracts the square of the known leg from c² and takes the square root.

Why must c be the longest side?

In a right triangle, c is the hypotenuse. It lies opposite the 90° angle and is always longer than either leg.

Does the Pythagorean theorem work on every triangle?

No. The equation a² + b² = c² applies specifically to right triangles. Other triangles require different methods.

What happens if I enter all three sides?

The calculator checks whether a² + b² is equal to c² within a small numerical tolerance. It then reports whether the values satisfy the Pythagorean theorem.

Can the side lengths contain decimals?

Yes. Positive decimal values are accepted. All side lengths should use the same unit.