Education & Study

Pythagorean theorem calculator

Missing hypotenuse or leg, exact radical form, angles, area and diagram.

  • Instant
  • Free
  • Private (processed locally)
  • No sign-up
What are you looking for?

Legs a and b form the right angle; c is the hypotenuse (the longest side, opposite the right angle).

Drawn to scale; the computed side is dashed.
Step-by-step solution

    ℹ️ In every right triangle, c² = a² + b². The exact form (simplified radical) appears when the squared result is a whole number. 100% local: nothing leaves your browser.

    Find any side of a right triangle with the Pythagorean theorem

    The Pythagorean theorem links the three sides of a right triangle: a² + b² = c², where c is the hypotenuse. Know two sides and you can find the third. This calculator does it instantly, whether you need the hypotenuse or a missing leg, and gives the exact value (such as 5√2) alongside the decimal approximation.

    It is one of the most widely used results in mathematics, from grade 8 in the US Common Core and Key Stage 3 or GCSE in the UK up to university: students checking homework, builders squaring a corner with the 3-4-5 rule, physics students adding perpendicular vectors. The tool also returns the angles, area, perimeter, altitude, projections, inradius and circumradius, a scale drawing and a written step-by-step solution.

    1. Choose the unknown

      Click “Find hypotenuse c” (the default), “Find leg a” or “Find leg b”. Legs a and b form the right angle.

    2. Enter the two known lengths

      Fill in the two visible fields (Leg a, Leg b or Hypotenuse c); decimals are fine. The Unit menu adds the chosen unit (cm, m, ft…) to every result, and the area is shown in square units (cm²).

    3. Read the result

      The missing side appears in large type, with its exact value (such as √50 = 5√2) when the squared result is a whole number, and a badge when the three sides form a Pythagorean triple. The “Copy” button puts the answer on your clipboard.

    4. Check the drawing and the steps

      The triangle is drawn to scale with the computed side dashed. Open “Step-by-step solution” to copy the working: formula, substitution, square root and, when needed, simplifying the radical.

    The Pythagorean formula and what the tool computes

    In a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides: c² = a² + b². For a leg, isolate its square: a = √(c² − b²). Every other measurement then follows from the three sides:

    • a and b: the legs that form the right angle; c: the hypotenuse, the longest side, opposite the right angle.
    • Acute angles: tan α = a / b and β = 90° − α, shown in degrees (2 decimals) and radians. α is the angle opposite leg a.
    • Area and perimeter: A = a × b / 2 (the legs act as base and height) and P = a + b + c.
    • Altitude to the hypotenuse: h = a × b / c, found by writing the area two ways.
    • Projections onto the hypotenuse: a² / c and b² / c; their product equals h² (for 3, 4, 5: 1.8 × 3.2 = 5.76 = 2.4²), the geometric mean relation.
    • Circles: inradius r = (a + b − c) / 2; circumradius R = c / 2, because the hypotenuse is a diameter of the circumscribed circle (Thales’s theorem).

    When the squared result is a whole number that is not a perfect square, the tool simplifies the radical by pulling out the largest square factor: √50 = √(25 × 2) = 5√2. The square of the unknown side is computed with exact decimal arithmetic, so 0.3 and 0.4 give exactly c = 0.5 with no floating-point noise.

    Pythagorean theorem worked examples

    UnknownGivenTool outputTakeaway
    ca = 3, b = 4c = 5primitive triple (3, 4, 5), area 6, α ≈ 36.87°
    ca = 5, b = 12c = 13primitive triple, altitude h ≈ 4.615385
    ca = 1, b = 1c = √2 ≈ 1.414214isosceles right triangle (half a square): α = β = 45°
    ca = 5, b = 5c = √50 = 5√2 ≈ 7.071068area 12.5
    bc = 10, a = 6b = 8(6, 8, 10) = 2 × (3, 4, 5), not primitive
    bc = 2, a = 1b = √3 ≈ 1.73205130-60-90 triangle: α = 30°, β = 60°

    Real-life uses of the Pythagorean theorem

    • Construction and DIY: the 3-4-5 rule checks a right angle; measure 60 cm and 80 cm along two walls and the diagonal must be exactly 100 cm.
    • Screens: a TV panel measuring 120 × 67.5 cm has a diagonal of 137.681698 cm, about 54.21 inches (1 in = 2.54 cm).
    • Ladders: a 5 m ladder with its foot 1.5 m from the wall reaches √22.75 ≈ 4.769696 m up the wall.
    • Ramps and roofs: a ramp running 6 m horizontally and rising 0.5 m is 6.020797 m long, at an angle of 4.76°. For a staircase, the stair calculator also gives the number of risers and the opening.
    • Coordinates and physics: two points 3 units apart in x and 4 units apart in y are 5 units apart (the distance formula); perpendicular forces of 30 N and 40 N have a 50 N resultant.

    Common mistakes

    • Adding the lengths instead of the squares: c is not a + b (3 + 4 = 7, yet c = 5).
    • Adding when you should subtract: for a leg, compute c² − b². If that is zero or negative, the hypotenuse you entered is too short.
    • Mixing units: legs of 1 m and 50 cm must first become 100 cm and 50 cm, which gives c = √12500 = 50√5 ≈ 111.803399 cm.
    • Rounding too early: 7.07² = 49.9849, not 50. Keep the exact value 5√2 until the end, then round.

    Every calculation runs locally in your browser: no data is sent anywhere. Limits: lengths between 10⁻¹⁰⁰ and 10¹⁰⁰, results rounded to 6 decimals (angles to 2), exact radical shown when the squared result is a whole number below 2⁵³. The drawing is no longer to scale when one side is much shorter than the other.

    Frequently asked questions

    What is the Pythagorean theorem formula?

    In a right triangle with legs a and b and hypotenuse c, a² + b² = c². For a = 3 and b = 4: c² = 9 + 16 = 25, so c = √25 = 5. The hypotenuse is always the side opposite the right angle and the longest of the three.

    How do I find a missing leg?

    Isolate its square: b² = c² − a², then b = √(c² − a²). With c = 10 and a = 6: b² = 100 − 36 = 64, so b = 8. The hypotenuse must be strictly longer than the known leg: with c = 5 and a = 5 no triangle exists, and the tool shows an error.

    Why does the tool show √50 = 5√2?

    That is the exact answer teachers expect. For a = b = 5, c² = 50 = 25 × 2, so c = √25 × √2 = 5√2 ≈ 7.071068. The exact radical appears whenever the squared result is a whole number that is not a perfect square (√2, √3, 5√2…); the decimal is only a rounded value.

    What is a Pythagorean triple?

    Three positive integers with a² + b² = c², such as (3, 4, 5), (5, 12, 13), (8, 15, 17) or (7, 24, 25). A triple is primitive when the three numbers have no common factor other than 1 (GCD = 1): (6, 8, 10) = 2 × (3, 4, 5) is not. Euclid’s formula (m² − n², 2mn, m² + n²), with whole numbers m > n > 0, produces as many as you like: m = 3 and n = 2 give (5, 12, 13).

    How can I tell whether a triangle is a right triangle?

    Use the converse of the theorem: compare the square of the longest side with the sum of the squares of the other two. For 5, 12, 13: 25 + 144 = 169 = 13², so it is a right triangle. For 4, 5, 6: 16 + 25 = 41 ≠ 36, so it is not (and since 36 < 41, all its angles are acute).

    How are the angles and the altitude calculated?

    With trigonometry: tan α = a / b, then β = 90° − α. For 3, 4, 5: α = arctan(0.75) ≈ 36.87° and β ≈ 53.13°. The altitude to the hypotenuse comes from writing the area two ways (a × b = c × h), so h = 12 / 5 = 2.4.