Skip to content
ZeroServer.tools

Pythagorean Theorem Calculator

Enter any two sides to find the third — plus angles, area, and perimeter.

Enter any two sides (leave the third blank to solve for it). c is the hypotenuse.

Side a
3
Side b
4
Side c (hypotenuse)
5
Angle A (opposite a)
36.869898 °
Angle B (opposite b)
53.130102 °
Angle C (right angle)
90 °
Area
6
Perimeter
12

The Pythagorean theorem explained

The Pythagorean theorem states that in a right triangle, a² + b² = c², where a and b are the two legs and c is the hypotenuse (the longest side, opposite the right angle). Given any two sides you can always find the third using algebra.

To solve any triangle (not just right triangles), use the Triangle Calculator. For area and perimeter of other shapes, try the Circle Calculator. For angle conversions, see Angle Converter.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Finding the hypotenuse from two known legs of a right triangle.
  • Finding a missing leg given the hypotenuse.
  • Checking whether three lengths form a right triangle.
  • Working out a diagonal for a layout or a construction.
  • Confirming a homework answer with the working shown.

Frequently Asked Questions

Do I have to know which side is the hypotenuse?
Yes, and the tool enforces it: c is always the hypotenuse. That is why entering a leg and a hypotenuse where c ≤ a is rejected rather than solved — b² would be negative. The hypotenuse is opposite the right angle and is always the longest side, so if your c is smaller than a leg, the labels are swapped.
What happens if I fill in all three sides?
It stops solving and starts checking. It compares a² + b² against c² and flags a mismatch when the relative difference exceeds 0.0001 — a tolerance, not an equality test, because measured sides never satisfy the theorem to the last decimal. 3, 4, 5 passes; 3, 4, 5.1 is reported as not a right triangle.
How are the two acute angles derived?
From atan2(a, b) converted to degrees, then B = 90 − A, because the three angles of any triangle sum to 180° and one of them is already fixed at 90°. For the 3-4-5 triangle that gives 36.87° and 53.13°. Only two sides are needed for the angles — the hypotenuse never enters that calculation.
Does it work for triangles that are not right-angled?
No, and it should not — a² + b² = c² is only true when the angle between a and b is exactly 90°. For any other triangle you need the Law of Cosines or the Law of Sines, which is what the Triangle Calculator implements across its SSS, SAS, AAS and ASA modes.
Why are results rounded to six decimal places?
Because √2 and its relatives are irrational, so any decimal output is a truncation. Six places keeps a millimetre exact on a kilometre-scale measurement while hiding the floating-point noise that would otherwise show 4.999999999999999 for a leg that is exactly 5.

Common errors and gotchas

  • Treating a leg as the hypotenuse, which is always the longest side.
  • Adding the squares when solving for a leg, where you must subtract.
  • Applying it to a triangle that is not right-angled, which needs the law of cosines.
  • Mixing units between the two known sides.
  • Rounding before squaring, which magnifies the error.

Related Calculators tools

Private & free — this tool runs entirely in your browser.