Pythagorean Theorem Calculator

Written by the StepSolvers Team  │  Reviewed by a Math Educator  │  Last updated July 2026

The Pythagorean theorem calculator finds the missing side of any right triangle — hypotenuse or leg — showing every step of the working. Enter any two sides and the third is calculated instantly using the formula a² + b² = c².

This free right triangle calculator handles all three modes: find the hypotenuse (c), find a missing leg (a or b), and verify whether three given side lengths form a valid right triangle. No signup required.

Unit:
Inputs in cm

Enter any two sides to find the third.

Step-by-Step Solution

    Final Answer:

    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.

    Pythagorean Theorem Formula and Variations

    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. Select your calculation mode: Find Missing Side to solve for c, a, or b — or Verify Right Triangle to check three existing side lengths.
    2. Enter the two known side lengths in the input fields. Leave the unknown field blank — the calculator determines what to solve for.
    3. Click Calculate. The missing side appears instantly alongside a full step-by-step solution showing the formula, substitution, and working.
    4. The SVG triangle diagram updates automatically to show your triangle with correct proportions and all three sides labelled.
    5. Use Verify Right Triangle mode to check whether three given lengths form a valid right triangle.
    6. Click Reset to clear all inputs and start a new calculation.

    The calculator accepts positive integers and decimals. It also detects and reports Pythagorean triples — sets of whole-number side lengths that satisfy a² + b² = c² exactly.

    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 Verify Right Triangle mode in the calculator above applies the converse automatically. Enter all three side lengths and it checks whether the equation holds, reporting the exact numerical difference if the triangle 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.

    Related Calculators

    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 Verify 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.