Pythagorean Theorem Calculator

Pythagorean theorem

Enter any two sides of a right triangle and the calculator returns the third using a^2 + b^2 = c^2. It handles both directions — giving the hypotenuse from the two legs, or one leg when you know the hypotenuse and the other leg. As a bonus it returns the triangle’s interior angles in degrees and radians, useful for any framing, layout or trig homework.

How the calculation works

  1. 1

    Pick what to solve for

    Hypotenuse (c) from legs a and b, or a leg (a or b) from the hypotenuse and the other leg.

  2. 2

    Enter two sides

    Any positive real numbers. Mixed units are your problem — make sure both sides use the same unit.

  3. 3

    Apply the theorem

    c = sqrt(a^2 + b^2), or a = sqrt(c^2 - b^2).

  4. 4

    Read the result

    Third side, plus angle opposite each side (90° is always between the two legs).

Common Pythagorean triples

Integer side lengths that satisfy a^2 + b^2 = c^2:

a b c
3 4 5
5 12 13
8 15 17
7 24 25
20 21 29
9 40 41

Multiples of any triple are also triples: 6-8-10, 9-12-15, and so on. Framers use 3-4-5 (in feet or inches) to square a corner on a building site — if one side is 3, another is 4, and the diagonal measures exactly 5, the corner is 90°.

When the theorem applies

Practical uses

Extending to 3D

For a rectangular box with sides a, b, c, the space diagonal is sqrt(a^2 + b^2 + c^2). The formula follows from applying Pythagoras twice: first to the base diagonal, then to that diagonal and the vertical side.

Frequently Asked Questions

Only right triangles (one 90° angle). For other triangles use the law of cosines, which generalises Pythagoras for any angle between the two known sides.

It is the smallest Pythagorean triple with integer sides. Framers and builders use it to square corners on-site because the measurements are easy to lay out with a tape.

Yes. The theorem works on any positive real numbers, not just integers. Most real-world measurements produce decimal outputs.

Negative side lengths do not have a physical meaning. The calculator refuses them; if you typed a minus by mistake, remove it.

Not reliably. Earth is a sphere; a flat-distance Pythagoras calculation over hundreds of kilometres is wrong by several percent. Use haversine or Vincenty for geodesic distance.

Related Tools