Toolzent

Pythagorean Theorem Calculator

Free Pythagorean theorem calculator. Find the hypotenuse or a missing leg of a right triangle from a2 + b2 = c2, with the formula and worked steps shown.

Updated 2026-06-09 · Free · No sign-up · Runs privately in your browser

What is the Pythagorean theorem calculator?

This Pythagorean theorem calculator finds the missing side of a right triangle from the two sides you already know. Enter two lengths and it applies the rule a² + b² = c², returning either the hypotenuse or a missing leg instantly — no manual squaring or square roots required.

The theorem links the three sides of any right triangle (a triangle with one 90-degree angle). The two shorter sides that form the right angle are the legs, labelled a and b. The longest side, opposite the right angle, is the hypotenuse, labelled c. The tool runs entirely in your browser, so nothing is uploaded and results appear the moment you type.

How does the calculator work?

The calculator uses one relationship in two directions.

To find the hypotenuse when both legs are known:

c = √(a² + b²)

To find a missing leg when the hypotenuse and one leg are known:

missing leg = √(c² − known leg²)

In both cases each side is squared, the squares are added or subtracted, and the square root of the result gives the unknown length. Because the hypotenuse is always the longest side, the calculator requires the hypotenuse to be longer than the known leg when you solve for a leg — otherwise c² − leg² would be zero or negative and no real triangle exists.

Terms and units. a and b are the legs; c is the hypotenuse. The theorem is purely about length, so there are no special units: enter every side in the same unit (all centimetres, or all inches) and the answer comes back in that same unit.

Examples

Each example below matches the calculator’s logic exactly. Type the same numbers in and you will get the same answer.

Example 1: find the hypotenuse from two legs

Legs a = 3 and b = 4.

  • c = √(a² + b²) = √(3² + 4²)
  • c = √(9 + 16) = √25
  • c = 5

This is the classic 3-4-5 right triangle.

Example 2: find a missing leg from the hypotenuse

Hypotenuse c = 13 and one leg a = 5.

  • other leg = √(c² − a²) = √(13² − 5²)
  • = √(169 − 25) = √144
  • other leg = 12

Example 3: another hypotenuse calculation

Legs a = 6 and b = 8.

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

The 6-8-10 triangle is just the 3-4-5 triangle doubled, which is why it also comes out whole.

Common Pythagorean triples reference table

A Pythagorean triple is a set of three whole numbers that satisfy a² + b² = c². Recognising them lets you spot exact answers without reaching for a calculator. The table also shows that any triple multiplied by a constant is itself a triple.

Leg aLeg bHypotenuse cCheck (a² + b² = c²)
3459 + 16 = 25
5121325 + 144 = 169
681036 + 64 = 100
8151764 + 225 = 289
9121581 + 144 = 225
7242549 + 576 = 625

Note how 6-8-10 and 9-12-15 are just the 3-4-5 triangle scaled by 2 and 3.

What is the Pythagorean theorem used for?

The theorem appears anywhere a right angle and a diagonal meet.

  • Construction and carpentry. Builders square up foundations and walls with the 3-4-5 method: measure 3 units along one edge, 4 along the other, and if the diagonal is exactly 5, the corner is a true right angle.
  • Navigation and distance. The straight-line distance between two points on a grid is √(horizontal² + vertical²) — the theorem is the engine behind the distance formula.
  • Screens and displays. A TV or monitor “size” is the diagonal. For a screen 16 wide and 9 tall (in the same unit), the diagonal is √(16² + 9²).
  • Stairs, ramps and ladders. The length of a ladder leaning against a wall is the hypotenuse formed by its height up the wall and its distance from the base.

Tips and common mistakes

  • √(a² + b²) is not a + b. The square root applies to the whole sum. For legs 3 and 4 the hypotenuse is √25 = 5, not 3 + 4 = 7.
  • Identify the hypotenuse first. It is always opposite the right angle and always the longest side. Plugging it in as a leg gives a wrong answer.
  • Subtract, do not add, when finding a leg. Solving for a leg uses c² minus the known leg’s square. Adding instead is a frequent slip.
  • The known leg must be shorter than the hypotenuse. If it is not, there is no real right triangle and the calculator will flag it.
  • Keep units consistent. Mixing feet and inches in the same triangle produces nonsense; convert first.

Limitations and notes

The Pythagorean theorem applies only to right triangles. If your triangle has no 90-degree angle, this relationship does not hold and you need the law of cosines instead. The calculator also assumes you are giving it valid side lengths: lengths must be positive, and when solving for a leg the hypotenuse must exceed the known leg.

Results for non-perfect triples are irrational and never terminate — for example, legs of 1 and 1 give a hypotenuse of √2 ≈ 1.414214 — so any decimal shown is a precise approximation rather than an exact value. When an exact answer matters, keep the radical form.

For related calculations, the square root calculator handles the √ step on its own and shows simplified radical form, the percentage calculator helps with everyday proportion work, and the scientific notation calculator is useful when your side lengths are very large or very small. Explore more tools in the math category.

This calculator is an educational and reference tool. For graded coursework or engineering work, double-check results and follow the rounding rules your instructor or specification requires.

Frequently asked questions

What is the Pythagorean theorem?+

It states that in a right triangle the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c², where c is the side opposite the right angle.

How do I find the hypotenuse?+

Square both legs, add them, then take the square root: c = √(a² + b²). For legs of 3 and 4, c = √(9 + 16) = √25 = 5.

How do I find a missing leg?+

Subtract the known leg's square from the hypotenuse's square, then take the root: leg = √(c² − known leg²). For c = 13 and a = 5, the other leg = √(169 − 25) = √144 = 12.

Does the Pythagorean theorem work for any triangle?+

No. It only applies to right triangles, those containing exactly one 90-degree angle. For other triangles you need the law of cosines instead.

Why must the hypotenuse be longer than each leg?+

The hypotenuse is opposite the right angle and is always the longest side. If you enter a known leg that is equal to or longer than the hypotenuse, c² − leg² is zero or negative and no real triangle exists.

What is a 3-4-5 triangle?+

It is the most common Pythagorean triple: legs of 3 and 4 give a hypotenuse of exactly 5, since 9 + 16 = 25. Scaling it, such as 6-8-10, also produces a perfect right triangle.

What units does the calculator use?+

Any single unit you like. As long as all sides share the same unit (cm, m, inches, feet), the answer comes out in that same unit.