Menu

Pythagorean Theorem Calculator

Two sides on a drawn triangle give the third, exactly - radicals included.

By Nethanel Bar, Co-founder & CEO

Last updated

Want to solve these without the calculator?

The Coddy math course teaches the method itself - you work each step on an interactive board and get told exactly where a move went wrong.

The squares on the legs add up to the square on the hypotenuse

On a right triangle, and only on a right triangle, a² + b² = c², where c is the hypotenuse - the side opposite the right angle and always the longest of the three. The statement is about AREAS: build a square on each of the two shorter sides and their combined area is exactly the area of the square built on the longest one. That is why everything gets squared and why the answer needs a square root at the end.

Which way the arithmetic runs depends on which side is missing, and that is where most mistakes live. Looking for the hypotenuse, you ADD the two squares. Looking for a leg, you SUBTRACT: a² = c² − b², because the hypotenuse's square is the total and the known leg's square is part of it. Adding when you should subtract gives an answer bigger than the hypotenuse, which is impossible - a useful check.

The answers here are exact. The hypotenuse of a triangle with legs 2 and 3 is √13, and √13 is what this page reports - with 3.6056 beside it, labelled as the rounding it is. √20 is simplified to 2√5 rather than left as it stands, and a triangle whose three sides come out whole is flagged as the Pythagorean triple it is.

What to notice

  • The theorem only holds on a right triangle. On any other triangle, a² + b² and c² are simply different numbers - there the law of cosines is the general version.
  • c is always the longest side. If your answer for the hypotenuse is smaller than a leg, an addition became a subtraction somewhere.
  • Finding a leg is a subtraction. a² = c² − b² follows straight from the theorem, and it is the case people get wrong far more often than the hypotenuse.
  • Most answers are irrational. Triangles with three whole sides - 3-4-5, 5-12-13 - are the exception, which is why the radical form matters.
  • The area of a right triangle is ab/2, the two legs multiplied and halved. The hypotenuse is not involved: the legs already meet at a right angle, so one is the base and the other the height.
  • Any multiple of a triple is a triple. 3-4-5 scaled by 3 gives 9-12-15, which is why the same few triangles keep reappearing in exercises.

How to find a missing side

  1. Identify the hypotenuse

    It is the side opposite the right angle, and the longest of the three. Getting this wrong makes every step afterwards wrong, so label it before you calculate anything.

  2. Decide whether you are adding or subtracting

    Missing hypotenuse: add the squares of the two legs. Missing leg: subtract the known leg's square from the hypotenuse's square.

  3. Square the sides you know

    Square first, then add or subtract. Squaring after adding - (a + b)² - is a different and much larger number.

  4. Take the square root

    That undoes the squaring and gives the side itself. If it does not come out whole, simplify the radical rather than reaching for a decimal: √20 is 2√5.

  5. Sanity-check the size

    The hypotenuse must be longer than either leg and shorter than their sum. If your answer breaks either rule, the addition and subtraction got swapped.

Right triangles at a glance

The triples worth memorising, and what happens when the answer is not whole. The exact column is the answer; the decimal is a rounding of it.

abcExactDecimal
34555
68101010
512131313
815171717
724252525
11√2√21.4142
23√13√133.6056
242√52√54.4721

Worked examples

The classic: legs 3 and 4

plain
a = 3, b = 4

3² + 4² = 9 + 16 = 25, and √25 = 5 exactly. This is the 3-4-5 triangle, the smallest one with three whole sides, and it is worth recognising on sight - as are its multiples 6-8-10 and 9-12-15.

An irrational hypotenuse: legs 2 and 3

plain
a = 2, b = 3

4 + 9 = 13, so the hypotenuse is √13. That is the answer - 3.6056 is a rounding of it, and squaring 3.6056 gives 12.9999… rather than 13. Most right triangles are like this one; the whole-number cases are the exception.

Simplifying the radical: legs 2 and 4

plain
a = 2, b = 4

4 + 16 = 20, and √20 is not left as it stands: 20 = 4 · 5, and the 4 comes out of the root as a 2, giving 2√5. Same number, and the form every marking scheme expects.

Finding a leg: hypotenuse 5, other leg 4

plain
b = 4, c = 5

Rearrange first: a² = c² − b² = 25 − 16 = 9, so a = 3. Adding instead would have given √41 ≈ 6.4, which is longer than the hypotenuse - impossible, and the check that catches this mistake immediately.

Fractional sides: legs 3/2 and 2

plain
a = 3/2, b = 2

9/4 + 4 = 25/4, and the square root of 25/4 is 5/2 exactly. Fractions stay fractions all the way through, which is why the answer is 5/2 rather than 2.5 - though both are the same number here.

Common mistakes

  • Adding when the missing side is a leg. The hypotenuse's square is the TOTAL, so finding a leg means subtracting from it.
  • Squaring the sum instead of summing the squares. a² + b² is not (a + b)²; the second is bigger by 2ab, which is never zero for a real triangle.
  • Labelling the wrong side as the hypotenuse. It is opposite the right angle, not simply the one drawn last or the one on the right.
  • Forgetting the square root. 3² + 4² = 25 is the square of the answer, not the answer - the hypotenuse is 5, not 25.
  • Using the theorem on a triangle with no right angle. It is only true for right triangles; anything else needs the law of cosines.
  • Rounding a radical too early. √13 squared is exactly 13, but 3.61 squared is 13.0321 - and in a multi-step problem that error grows.

Pythagorean theorem FAQ

What is the Pythagorean theorem?
On a right triangle, a² + b² = c², where a and b are the two shorter sides (the legs) and c is the hypotenuse opposite the right angle. Read as areas: the squares built on the two legs have exactly the combined area of the square built on the hypotenuse.
How do I find the hypotenuse?
Square both legs, add them, and take the square root: c = √(a² + b²). For legs 3 and 4 that is √25 = 5. If the root does not come out whole, keep it as a simplified radical - √20 becomes 2√5.
How do I find a leg instead?
Subtract, do not add: a² = c² − b², so a = √(c² − b²). With a hypotenuse of 5 and a leg of 4 that is √(25 − 16) = 3. This is the case that goes wrong most often, and the check is that a leg must always be shorter than the hypotenuse.
What is a Pythagorean triple?
Three whole numbers that satisfy the theorem: 3-4-5, 5-12-13, 8-15-17, 7-24-25. Any multiple of a triple is also a triple, so 6-8-10 and 9-12-15 come free with 3-4-5. Most right triangles are NOT triples, which is why irrational answers are the norm.
Does the theorem work on any triangle?
No - only on right triangles. For any other triangle the general statement is the law of cosines, c² = a² + b² − 2ab·cos(C), which reduces to the Pythagorean theorem exactly when C is 90° and its cosine is zero.
Why does this page keep square roots instead of decimals?
Because a radical is the exact answer and a decimal is a rounding of it. √13 squared is 13 on the nose; 3.61 squared is 13.0321. In a multi-step problem that difference compounds, and most marking schemes want the exact form anyway.
How do I check whether a triangle is right-angled?
Test the theorem on the three sides you have: if a² + b² equals c² exactly, with c the longest side, the triangle has a right angle. If the left side is bigger the angle is acute, and if smaller it is obtuse - which is the converse of the theorem and a genuinely useful check.
Can the calculator handle fractions and decimals?
Yes, and both stay exact. Legs of 3/2 and 2 give a hypotenuse of exactly 5/2, and a decimal input is read as the exact fraction it names rather than as a floating-point approximation of it.

More math tools

Coddy programming languages illustration

Learn math with Coddy

GET STARTED