Skip to content

Pythagorean Theorem Calculator

Two sides of a right triangle are enough to pin down the third. Enter the ones you have, leave the unknown box empty, and the tool solves a² + b² = c² for it, whichever side that is. You get the worked steps in the order a teacher marks them, the answer as a simplified square root as well as a decimal, and the triangle drawn to scale with both acute angles. The same equation gets typed a2 + b2 = c2 or a^2 + b^2 = c^2 when superscripts are not available, and this page covers what it means and how to rearrange it, finding the hypotenuse and finding a leg.

a² + b² = c²

Fill in the two sides you know and leave the third box empty. Any unit works, and the answer comes back in that same unit.

Hypotenuse c

c = 5

3² + 4² = 5²Pythagorean triple

Area
6 sq units
Perimeter
12 units
Angles
36.87° · 53.13° · 90°

The steps

  1. Step 1. Start with the Pythagorean theorem

    a² + b² = c²

  2. Step 2. Substitute the two legs

    3² + 4² = c²

  3. Step 3. Square each leg and add

    9 + 16 = 25 = c²

  4. Step 4. Take the square root of both sides

    c = √25 = 5

The triangle

36.9°53.1°a = 3b = 4c = 5

Drawn to scale from your numbers. The ochre side is the one that was solved for, and the square in the corner marks the right angle, which is always opposite the hypotenuse.

How to solve a2 + b2 = c2 for each side

Square the two lengths you know, add them if the missing side is the hypotenuse or subtract them if it is a leg, then take the square root of the result.

a² + b² = c²

Rearranged for whichever side is missing. c is always the hypotenuse, the side facing the right angle, and it is always the longest of the three.

c = √(a² + b²)    a = √(c² − b²)    b = √(c² − a²)

Superscripts are awkward to type, so the same three lines are often written a^2 + b^2 = c^2, a2+b2=c2, or spelled out as a squared plus b squared equals c squared. They all mean this equation, and the calculator accepts the numbers either way since you only ever enter side lengths.

Finding the hypotenuse, step by step

Legs of 6 and 8. Both legs are known, so the two squares get added.

  1. Step 1. Start with the Pythagorean theorem

    a² + b² = c²

  2. Step 2. Substitute the two legs

    6² + 8² = c²

  3. Step 3. Square each leg and add

    36 + 64 = 100 = c²

  4. Step 4. Take the square root of both sides

    c = √100 = 10

That triangle has an area of 24 square units and angles of 36.87° and 53.13°. It is the 3-4-5 triangle doubled, which is why the answer lands on a whole number.

Finding a leg, step by step

A hypotenuse of 15 and one leg of 9. Here the equation has to be rearranged first, and the squares get subtracted rather than added. Adding them is the single most common mistake in this direction.

  1. Step 1. Start with the Pythagorean theorem

    a² + b² = c²

  2. Step 2. Rearrange for the missing leg

    a² = c² − b²

  3. Step 3. Substitute the hypotenuse and the known leg

    a² = 15² − 9²

  4. Step 4. Square both and subtract

    a² = 225 − 81 = 144

  5. Step 5. Take the square root of both sides

    a = √144 = 12

When the answer is a square root

Whole-number answers are the exception. Legs of 4 and 6 give c = √52 = 2√13 ≈ 7.211103. The middle form is the simplified radical: 52 factors into 4 × 13, and the 4 comes out of the root as a 2. Homework usually wants that exact form, a tape measure wants the decimal, so the calculator prints both on the last step whenever the radicand is a whole number.

Pythagorean triples worth memorizing

Six primitive triples, meaning the three numbers share no common factor. Multiply any row by the same number and it is still a right triangle, so 3-4-5 also gives 6-8-10, 9-12-15 and so on. Every row here was solved by the calculator at build time.

Leg a Leg b Hypotenuse c Check Angles
3 4 5 9 + 16 = 25 36.9° · 53.1°
5 12 13 25 + 144 = 169 22.6° · 67.4°
8 15 17 64 + 225 = 289 28.1° · 61.9°
7 24 25 49 + 576 = 625 16.3° · 73.7°
20 21 29 400 + 441 = 841 43.6° · 46.4°
9 40 41 81 + 1600 = 1681 12.7° · 77.3°

Where the theorem actually gets used

  • Squaring a corner. Mark 3 feet along one wall and 4 along the other. If the diagonal is 5, the corner is square. Bigger multiples like 6-8-10 are more forgiving of a small measuring error.
  • Roof rafters and ramps. Rise and run are the legs, the rafter or ramp surface is the hypotenuse.
  • Diagonal of a screen or a room. A 48 by 27 inch panel has a diagonal of √(48² + 27²), which is where the advertised inches come from.
  • Distance between two points. The distance formula is the theorem with the legs written as the differences in x and y.
  • Combining two velocities. A projectile's speed is √(vx² + vy²), the horizontal and vertical components treated as legs.
  • Ladder safety. Ladder length is c, the distance from the wall is one leg, so the height it reaches is the other.

How to use this calculator

  1. Find the right angle in your triangle. The side opposite it is the hypotenuse, so that value goes in c.
  2. Put the other two lengths in a and b. They are interchangeable, so it makes no difference which is which.
  3. Leave the box you want solved empty. It gets outlined in ochre and the result updates as you type.
  4. Read the steps below the answer to copy the working, and check the diagram to confirm the shape matches what you measured.

Frequently Asked Questions

What is the Pythagorean theorem?
In any right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides: a² + b² = c², where c is the hypotenuse, the side opposite the right angle. It only holds for right triangles, and it works in both directions, so a triangle whose sides satisfy the equation must have a right angle.
What does a2 + b2 = c2 mean?
It says that the two legs of a right triangle, each squared and then added, equal the square of the hypotenuse. a and b are the shorter sides that meet at the right angle, c is the side opposite it. The equation is the Pythagorean theorem written out, typed a^2 + b^2 = c^2 or a2+b2=c2 where superscripts are not available, and read aloud as a squared plus b squared equals c squared.
How do you find the hypotenuse?
Square both legs, add them, then take the square root: c = √(a² + b²). For legs of 6 and 8 that is √(36 + 64) = √100 = 10. Leave the c box empty in the calculator and it does exactly those lines.
How do you find a missing leg?
Subtract instead of add: a = √(c² − b²), or in plain text a = sqrt(c^2 - b^2). With a hypotenuse of 15 and a leg of 9, that is √(225 − 81) = √144 = 12. The rearrangement is the step most people skip, so the calculator prints it before substituting your numbers.
Why does the calculator refuse a hypotenuse shorter than a leg?
Because no such right triangle exists. The hypotenuse is opposite the largest angle, the 90 degree one, so it is always the longest side. If c is smaller than a leg, then c² − leg² is negative and the square root is imaginary. Usually it means the two sides got entered in the wrong boxes.
What if the answer is not a whole number?
Most of the time it isn't. Legs of 4 and 6 give c = √52, which simplifies to 2√13, about 7.211103. The calculator shows the simplified radical next to the decimal, because the exact form is what most homework expects and the decimal is what you need for measuring.
What are Pythagorean triples?
Sets of three whole numbers that satisfy the theorem, such as 3-4-5, 5-12-13 and 8-15-17. Any multiple of a triple is also a triple, so 6-8-10 and 30-40-50 work too. Builders use the 3-4-5 version to square up corners without a protractor.
Can I use the theorem to check whether a corner is square?
Yes, that is the 3-4-5 method. Measure 3 units along one edge, 4 along the other, and mark both points. If the diagonal between them measures exactly 5, the corner is 90 degrees. Any multiple works and larger ones are more accurate, so 6-8-10 feet or 30-40-50 inches are common on site.
Does the theorem work for triangles that are not right-angled?
No. For those you need the law of cosines, c² = a² + b² − 2ab·cos(C), which reduces to the Pythagorean theorem when angle C is 90 degrees and the cosine term drops to zero.
What units should I use?
Any, as long as all the sides use the same one. The theorem is a ratio between lengths, so inches in means inches out. The area shown in the result is in square units of whatever you entered.
Is anything I type sent to a server?
No. The calculator, the steps and the diagram are all generated in your browser. Nothing is stored or transmitted.

Related Calculators