Asistente RD

Pythagorean theorem calculator

Solve the Pythagorean theorem a²+b²=c²: enter two sides to get the third, plus the right triangle area and perimeter. Free, instant, no sign-up.

Free · No sign-up · In your browser

Pick the side you are missing, type the two you know, and get the remaining side, area and perimeter of the right triangle instantly.

a² + b² = c²

Hypotenuse c

5

units

Area

6

Perimeter

12

units

Share on WhatsApp Last reviewed: July 9, 2026

What the Pythagorean theorem is

The Pythagorean theorem connects the three sides of a right triangle, one with a 90° angle. The two sides that meet at that right angle are the legs (a and b), and the side across from it, always the longest, is the hypotenuse (c). The theorem states that the square of the hypotenuse equals the sum of the squares of the legs:

a² + b² = c²

That single equation lets you find any side once you know the other two. It is one of the most useful tools in geometry: it measures straight-line distances, checks whether a corner is truly square, gives the diagonal of a screen or a plot of land, and turns up constantly in physics, construction and design.

How to use the calculator

  1. In the menu, choose which side you are missing: the hypotenuse (if you know both legs) or a leg (if you know one leg and the hypotenuse).
  2. Type the two values you do know. Everything updates as you type, with no “calculate” button.
  3. Read the missing side, the area and the perimeter of the triangle.
  4. Press Copy result to drop the summary into your notes.

If you are solving for a leg and enter a hypotenuse shorter than the known leg, the calculator warns you: that triangle is impossible, because the hypotenuse is always the longest side.

The formulas

Starting from a² + b² = c², you isolate the missing side:

  • Hypotenuse: c = √(a² + b²)
  • A leg: b = √(c² − a²), valid only when c is greater than a.

The area of a right triangle is half the product of its legs, area = a·b / 2, because the two legs act as base and height. The perimeter is the sum of the three sides.

Sets of three whole numbers that satisfy the theorem are called Pythagorean triples. Here are the best known ones:

Leg aLeg bHypotenuse cCheck
3459 + 16 = 25
5121325 + 144 = 169
681036 + 64 = 100
8151764 + 225 = 289
7242549 + 576 = 625

Worked example

You have a right triangle whose legs measure a = 3 and b = 4. To find the hypotenuse:

  • c = √(3² + 4²) = √(9 + 16) = √25 = 5.
  • Area: 3 · 4 / 2 = 12 / 2 = 6.
  • Perimeter: 3 + 4 + 5 = 12.

Now the other way around: you know one leg a = 5 and the hypotenuse c = 13, and you want the other leg:

  • b = √(13² − 5²) = √(169 − 25) = √144 = 12.
  • Area: 5 · 12 / 2 = 60 / 2 = 30.
  • Perimeter: 5 + 12 + 13 = 30.

Both cases are exact Pythagorean triples, so the results come out as whole numbers.

Frequently asked questions

Which side is the hypotenuse?

The hypotenuse is always the side opposite the right angle, and therefore the longest side of the triangle. The other two, which meet at the 90° angle, are the legs. If a “third side” comes out shorter than one of the others, you have swapped the hypotenuse for a leg.

Does it work for any triangle?

No. The Pythagorean theorem holds only for right triangles, those with an angle of exactly 90°. For triangles without a right angle you use the law of cosines, which is a generalization of it.

Why does it say “impossible”?

Because you asked to find a leg but entered a hypotenuse smaller than or equal to the known leg. Since the hypotenuse must be the longest side, that combination cannot form a right triangle. Double-check which value is really the hypotenuse.

Do the sides have to be whole numbers?

No. You can use decimals freely: most real triangles are not exact triples. For instance, two legs of 1 give a hypotenuse of √2 ≈ 1.4142. The calculator rounds to 4 decimals so the number stays readable.

What units does it use?

Whatever you like: centimeters, meters, inches, pixels. The theorem is purely geometric, so you only need the two sides you enter to be in the same unit. The result comes out in that same unit, and the area in square units.

Related tools