Pythagorean Theorem Calculator

Last updated October 2026

A Pythagorean theorem calculator finds the missing side of a right triangle using a² + b² = c², such as legs 3 and 4 giving a hypotenuse of 5. This free tool also checks whether three lengths form a right triangle, measures 2D and 3D distance, lists Pythagorean triples and solves any triangle. Every result comes with a step-by-step solution, a diagram where it applies and a check of the answer, with no signup.

Calculation

Find the hypotenuse (c)

Press Enter to calculate

Formula

What Is the Pythagorean Theorem?

The Pythagorean theorem is a fundamental equation in geometry that describes the relationship between the three sides of a right triangle. It states that the square of the hypotenuse is equal to the sum of the squares of the two shorter sides, the legs. Wolfram MathWorld's entry on the Pythagorean theorem catalogs dozens of the historical proofs of this relationship, if you want to go deeper than the summary below.

The Pythagorean Theorem a² + b² = c²
a and b = the two shorter sides (legs) of the right triangle
c = the hypotenuse (longest side, opposite the right angle)
Right angle = 90°, always located between sides a and b

The theorem only applies to right triangles, triangles that contain exactly one 90-degree angle. For any other triangle type (acute or obtuse), the relationship a² + b² = c² does not hold.

Key Parts of a Right Triangle

TermDefinition
Hypotenuse (c) The longest side of a right triangle, always opposite the right angle. This is what you solve for most often.
Legs (a and b) The two shorter sides that form the right angle. Also called the adjacent and opposite sides.
Right angle The 90-degree angle between the two legs. Usually marked with a small square in diagrams.
Pythagorean triple A set of three positive integers that satisfy a² + b² = c². Classic example: 3, 4, 5.

Algebraic Proof of the Pythagorean Theorem

The theorem can be proven algebraically by arranging four identical copies of the same right triangle (legs a and b, hypotenuse c) around a square. There are two ways to arrange them, and both lead to the same equation.

Arrangement 1: A Larger Square

Arrange the four triangles around the small square (side c) so they form one larger square with side length (a + b). The larger square's total area can be written two ways:

Area of large square = (a + b)²
Also equals: the small square (c²) plus four triangles (each ½ab)
(a + b)² = c² + 4(½ab) = c² + 2ab

Expanding the left side and cancelling the 2ab term from both sides:

(a + b)² = a² + 2ab + b²
a² + 2ab + b² = c² + 2ab
a² + b² = c²

Arrangement 2: A Smaller Enclosed Square

Alternatively, arrange the same four triangles so they form a smaller enclosed square with side (b − a), inside a larger square with side c. Here, the larger square's area equals the small enclosed square plus the four triangles:

c² = (b − a)² + 4(½ab)
c² = b² − 2ab + a² + 2ab
c² = a² + b²

Both arrangements cancel out to the same result, which is exactly why the theorem is considered proven rather than just observed, it holds for every right triangle, not just the specific examples above.

Pythagorean Theorem Formula and Variations

The same equation, a² + b² = c², can be rearranged to solve for whichever side is unknown. Use whichever version below matches what you already have.

Finding the Hypotenuse (c)

When both legs are known, solve for the hypotenuse using the standard form of the formula. Square both legs, add the results, then take the square root of the sum.

Find c, Hypotenuse c = √(a² + b²)

Finding a Missing Leg (a or b)

When the hypotenuse and one leg are known, rearrange the formula to isolate the missing side. Subtract the known leg squared from the hypotenuse squared, then take the square root. Both rearrangements follow directly from the original equation a² + b² = c² by moving terms to opposite sides. The calculator applies the correct rearrangement automatically based on which two sides you enter.

Find a or b, Missing Leg To find leg a:   a = √(c² − b²)
To find leg b:   b = √(c² − a²)

How to Use This Pythagorean Theorem Calculator

  1. Pick a tab. Find c solves for the hypotenuse, Find a and Find b solve for a missing leg, and Right triangle? tests three lengths. The other tabs cover 2D distance, 3D distance, Pythagorean triples and any triangle.
  2. Choose a unit (cm, m, in or ft) and type the known sides. Decimals are accepted.
  3. Click Calculate or press Enter. The Step-by-Step Solution box opens directly under the inputs.
  4. Read the answer, the numbered steps and the diagram. For right-triangle tabs the diagram shows a square on each side, so you can see a² + b² = c² as areas.
  5. Use Check your answer to confirm the result, then Share result or Download PDF to save the working as a PDF.
  6. Click Reset to clear the inputs and start again.

The calculator accepts positive integers and decimals, and flags Pythagorean triples, sets of whole-number sides that satisfy a² + b² = c² exactly. If the hypotenuse you enter is not the longest side, it explains why no right triangle fits.

What the Step-by-Step Solution Shows

After you press Calculate, the answer box lists everything needed to follow the method and verify the result, not just the final number.

Limits and Rounding

Answers are rounded to 4 decimal places, and a rounded answer is marked with the ≈ sign while an exact one uses an equals sign. The theorem only applies to right triangles, so use the Triangle solver tab for triangles without a right angle. For the 2D and 3D tabs, the numbers can be negative because only their squares are used. The Triples tab accepts an upper limit from 5 to 1000.

Worked Examples, Step by Step

Example 1: Find the Hypotenuse (the 3-4-5 Right Triangle)

This is the most well-known Pythagorean triple. Given legs a = 3 and b = 4, find the hypotenuse c.

a = 3 b = 4 c = 5
  1. Write the known values: a = 3, b = 4. Finding: c (hypotenuse)
  2. Apply the formula: c² = a² + b²
  3. Substitute the values: c² = 3² + 4²
  4. Calculate each square: c² = 9 + 16
  5. Add the squares: c² = 25
  6. Take the square root: c = √25 = 5
Pythagorean triple check: 3² + 4² = 9 + 16 = 25 = 5² ✓, This is a Pythagorean triple.

Example 2: Find a Missing Leg (the 5-12-13 Triple)

Given hypotenuse c = 13 and one leg b = 5, find the missing leg a.

  1. Write the known values: c = 13, b = 5. Finding: leg a
  2. Rearrange the formula to isolate a: a² = c² − b²
  3. Substitute the values: a² = 13² − 5²
  4. Calculate each square: a² = 169 − 25
  5. Subtract: a² = 144
  6. Take the square root: a = √144 = 12
Pythagorean triple check: 5² + 12² = 25 + 144 = 169 = 13² ✓, The 5-12-13 triple is the second most common after 3-4-5.

Example 3: Verify a Right Triangle (the 7-24-25 Triple)

Given three sides: a = 7, b = 24, c = 25. Is this a right triangle?

  1. Identify the longest side as the hypotenuse: c = 25
  2. Apply the converse: check if a² + b² = c²
  3. Calculate: 7² + 24² = 49 + 576 = 625
  4. Calculate c²: 25² = 625
  5. Compare: 625 = 625 ✓, the equation holds
✅ Yes, this is a right triangle
7-24-25 is a Pythagorean triple. Other common triples: 8-15-17, 9-40-41, 6-8-10.
Note: Multiples of any Pythagorean triple also form right triangles, e.g. 6-8-10 is 3-4-5 multiplied by 2.

When to Use the Pythagorean Theorem

The Pythagorean theorem applies in any situation that involves a right angle and two known side lengths. Its real-world applications extend far beyond the classroom:

Does the Pythagorean Theorem Work on All Triangles?

No, the Pythagorean theorem applies exclusively to right triangles. For acute and obtuse triangles, the relationship between sides follows a different rule:

Triangle typeRelationship between sides a, b, c (c = longest side)
Right triangle a² + b² = c²   (Pythagorean theorem applies exactly)
Acute triangle a² + b² > c²   (sum of squares exceeds the longest side squared)
Obtuse triangle a² + b² < c²   (sum of squares is less than the longest side squared)

These relationships are the basis of the converse of the Pythagorean theorem, you can use them to determine what type of triangle you have from side lengths alone, without measuring any angles.

The Converse of the Pythagorean Theorem

The converse states: if the square of the longest side of a triangle equals the sum of the squares of the other two sides, then the triangle is a right triangle. It works in both directions, you can use a² + b² = c² to find a missing side, or to verify whether a triangle contains a right angle.

Forward (find a side) Given a right triangle with legs a and b
→ find hypotenuse: c = √(a² + b²)
Converse (verify a triangle) Given three sides a, b, c
→ check if a² + b² = c²
True → right triangle ✓
False → acute or obtuse ✗

The Right triangle? tab in the calculator above applies the converse automatically. Enter all three side lengths in any order and it checks whether the equation holds, reporting the exact numerical difference and whether the triangle is acute or obtuse if it is not a right triangle.

Common Mistakes with the Pythagorean Theorem

  • Applying the formula to a non-right triangle: a² + b² = c² only holds for right triangles. For any other triangle, use the Law of Cosines instead.
  • Mixing up the hypotenuse with a leg: the hypotenuse is always the longest side and always opposite the right angle, substituting it into the wrong position in the formula gives an incorrect result.
  • Forgetting to take the square root at the end: c² = 25 means c = 5, not c = 25. This is a common last-step error, especially when working quickly.

Frequently Asked Questions

What is the Pythagorean theorem?
The Pythagorean theorem states that in any right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c². It is named after the ancient Greek mathematician Pythagoras, though evidence of the relationship was known in Babylonian and Indian mathematics long before his time.
How do I do the Pythagorean theorem step by step?
Identify which side is unknown. Label the two legs a and b and the hypotenuse c. To find c, calculate c = √(a² + b²). To find a missing leg, rearrange to a = √(c² − b²). Substitute your known values, compute the squares, add or subtract them, and take the square root of the result. The calculator above shows every step of this process automatically.
Does the Pythagorean theorem work on all triangles?
No. The theorem only applies to right triangles, triangles with exactly one 90-degree angle. For acute triangles, a² + b² > c². For obtuse triangles, a² + b² < c². If you need to work with non-right triangles, the Law of Cosines is the general rule that applies to all triangle types.
What is a Pythagorean triple?
A Pythagorean triple is a set of three positive integers that satisfy a² + b² = c² exactly, producing a right triangle with whole-number sides. The most common examples are 3-4-5, 5-12-13, 8-15-17, and 7-24-25. Any integer multiple of a Pythagorean triple (e.g. 6-8-10 from 3-4-5) also forms a right triangle.
What is the converse of the Pythagorean theorem?
The converse states: if a² + b² = c² holds for the three sides of a triangle, then the triangle must be a right triangle. This allows you to verify whether any set of three side lengths produces a right angle, without measuring the angle directly. Use the Right triangle? tab in the calculator to check any set of lengths.
How to find b in the Pythagorean theorem?
Rearrange the formula to isolate b: b = √(c² − a²). You need the hypotenuse c and the other leg a. Square both known values, subtract a² from c², then take the square root of the result. For example, if c = 10 and a = 6: b = √(100 − 36) = √64 = 8.
Is the Pythagorean theorem only for right triangles?
Yes. The equation a² + b² = c² is only valid when the angle between legs a and b is exactly 90 degrees. The hypotenuse is always the side opposite this right angle and is always the longest side. For triangles without a right angle, use the Law of Cosines: c² = a² + b² − 2ab·cos(C).
When was the Pythagorean theorem discovered?
The relationship was known in ancient Babylon and India before 500 BCE, but Pythagoras of Samos (c. 570–495 BCE) is credited with the first recorded mathematical proof. The theorem bears his name due to his school's formal proof and the prominence of Greek mathematics in Western history. It remains one of the most proved theorems in mathematics, with over 370 known proofs.

Related Calculators

Author

StepSolvers Team

StepSolvers is a free collection of step-by-step math calculators. The StepSolvers team builds every calculator to show its full working, not just the final answer, so you can follow each step and learn the method. About StepSolvers