Category

Pythagorean Theorem Calculator

Formula

Enter your values

Enter your values and press Calculate — your answer, visual and step-by-step solution appear here.

What Is the Pythagorean Theorem?

The Pythagorean theorem states that in any right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides. In symbols, this is written a² + b² = c², where a and b are the lengths of the two legs and c is the length of the hypotenuse. This relationship holds for every right triangle, no matter its size.

a² + b² = c²

The two shorter sides that meet at the 90° angle are called the legs (here a and b). The hypotenuse (c) is the side directly opposite the right angle, and it is always the longest side of the triangle. The diagram and calculator above label these sides for you so you can see exactly which value goes where.

The Pythagorean Theorem Formula (and How to Rearrange It)

The core equation a² + b² = c² can be rearranged to solve for whichever side is missing. Because the calculator above has three solve modes, each rearrangement matches one mode you can pick. The three forms are:

What you wantFormula
Find the hypotenuse (c)c = √(a² + b²)
Find a leg (a)a = √(c² − b²)
Find a leg (b)b = √(c² − a²)

Notice that the hypotenuse formula adds the squares, while the leg formulas subtract. This is because the hypotenuse is always larger than either leg: to recover a leg you must remove the other leg's square from the hypotenuse's square. A practical consequence is that the hypotenuse you enter must be greater than the known leg — otherwise the value under the square root becomes negative and no real right triangle exists.

How to Use This Pythagorean Theorem Calculator

  1. Choose what you are solving for. Use the mode tabs to pick the hypotenuse (c) or a missing leg (a or b).
  2. Enter the two sides you know. Type your measurements into the input fields. Any consistent unit works — inches, centimeters, meters — as long as both sides use the same one.
  3. Press Calculate. The calculator solves the equation instantly.
  4. Read the full result. You get the missing side, the two computed angles, a to-scale triangle diagram, a built-in sense-check, and a step-by-step breakdown of the work.

In a hurry? Tap one of the example chips (3-4-5, 5-12-13, 8-15-17, 6-8) to load a worked problem and see the calculator in action before entering your own numbers.

Worked Examples (Step by Step)

Find the Hypotenuse (3-4-5)

  1. Given. The two legs are a = 3 and b = 4; we want the hypotenuse c.
  2. Set up. Substitute into a² + b² = c² to get 3² + 4² = c².
  3. Solve. 9 + 16 = 25, so c² = 25 and c = √25.
  4. Answer. c = 5. This is the famous 3-4-5 right triangle.

Find a Missing Leg

  1. Given. The hypotenuse is c = 13 and one leg is b = 5; we want the other leg a.
  2. Set up. Rearrange to a = √(c² − b²), giving a = √(13² − 5²).
  3. Solve. 169 − 25 = 144, so a = √144.
  4. Answer. a = 12. These sides form the 5-12-13 triple.

An Answer That Isn't a Whole Number

  1. Given. The legs are a = 2 and b = 3; we want the hypotenuse c.
  2. Set up. Substitute into c = √(a² + b²) to get c = √(2² + 3²).
  3. Solve. 4 + 9 = 13, so c = √13.
  4. Answer. The exact value is √13, which rounds to about 3.61. Keep √13 when you need an exact answer; round to 3.61 when a decimal is more useful. After solving, you can find the area and perimeter of a triangle from these same side lengths.

Common Pythagorean Triples

A Pythagorean triple is a set of three whole numbers that satisfy a² + b² = c² — meaning they form a right triangle with no decimals or radicals. The table below lists the most common primitive triples (those that share no common factor):

abc
345
51213
81517
72425
202129
94041

Any whole-number multiple of a triple is also a triple. For example, doubling 3-4-5 gives 6-8-10, and tripling it gives 9-12-15 — both are valid right triangles. Advanced readers can generate new triples with Euclid's formula: pick two positive integers m > n, then a = m² − n², b = 2mn, and c = m² + n².

Real-World Uses of the Pythagorean Theorem

How to Tell If a Triangle Is a Right Triangle (the Converse)

The converse of the Pythagorean theorem lets you test any triangle once you know all three sides. Label the longest side c and compare a² + b² with c²:

For a quick check, take sides 6, 8, and 10: 6² + 8² = 36 + 64 = 100, and 10² = 100. Since the two are equal, 6-8-10 is a right triangle. A "right triangle checker" simply runs this comparison for you.

A Quick Proof of the Pythagorean Theorem

Here is a short rearrangement proof. Place four identical right triangles (legs a and b, hypotenuse c) around the inside of a large square whose side is a + b, with their hypotenuses forming a smaller tilted square of side c in the middle. The large square's area is (a + b)². It also equals the four triangles plus the inner square: 4 · (½ab) + c². Setting these equal gives (a + b)² = 2ab + c², which expands to a² + 2ab + b² = 2ab + c². Cancel 2ab from both sides and you are left with a² + b² = c². This area-based argument is the classic proof attributed to Pythagoras and appears in standard geometry references such as Euclid's Elements.

Remember: The Pythagorean theorem only works for right triangles. For a triangle with no 90° angle, use the law of cosines instead.

Common Mistakes

Mistake — Treating a leg as the hypotenuseThe hypotenuse is always the longest side and sits opposite the right angle. Identify the 90° corner first, then label the side across from it as c before plugging into the formula.
Mistake — Adding when you should subtractUse a² + b² = c² only when finding the hypotenuse. To find a missing leg, subtract: a = √(c² − b²). Adding the squares of a leg and the hypotenuse gives a wrong, too-large answer.
Mistake — Forgetting the square rootThe formula gives you c², not c. After computing a² + b², take the square root to get the actual side length. Stopping at 25 instead of √25 = 5 is a common slip.
Mistake — Mixing up unitsBoth sides must be in the same unit before you calculate. Convert feet and inches (or meters and centimeters) to a single unit first, or your hypotenuse will be meaningless.
Mistake — Using it on a non-right triangleThe theorem applies only to right triangles. If the triangle has no 90° angle, a² + b² = c² does not hold — switch to the law of cosines.

Frequently Asked Questions

Not a right triangle? Use the law of sines or the law of cosines. This guide shows how to choose between them, and how the law of cosines reduces to the Pythagorean theorem at 90°.