Skip to main content

Pythagorean Theorem Calculator

In a right-angled triangle, the square of the hypotenuse equals the sum of the squares of the other two sides. Give this tool any two sides and it finds the third — solving for the hypotenuse c or for either leg — together with the triangle's area, perimeter, and two acute angles. Answers are exact: when the missing side is a whole or fractional number you get it in full, and when it is irrational you get the simplified radical (√2, 2√5, …) with the decimal beside it.

Which side is missing?

Side c

5

Exact — no rounding anywhere in this answer.

Side a

3

Side b

4

Hypotenuse c

5

Area (½ × a × b)

6

Perimeter (a + b + c)

12

Angles opposite a and b

36.8698976458° and 53.1301023542°

The third angle is 90° by definition. Angles print to 10 decimal places.

How it is worked out

  1. c² = a² + b² = 3² + 4² = 25.
  2. c = √25 = 5 exactly.
  3. Area = ½ × a × b = 6; perimeter = a + b + c = 12.

Embed this calculator on your website →

The formula

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

  • c is the hypotenuse — the side opposite the right angle, always the longest side. That is why solving for a leg refuses a “leg” that is not shorter than the hypotenuse you enter: no such triangle exists.
  • exact versus radical — the squared side is an exact fraction; if it is a perfect-square rational, its root prints exactly (√25 = 5). Otherwise the root prints in simplified radical form with a 10-decimal value, and the steps note that the perimeter then uses that decimal.
  • area and angles — area is ½ × a × b (the legs are each other's base and height); the acute angles come from the arctangent of the leg ratio and print to 10 decimal places, since angles have no exact form to print.

Worked example: legs 3 and 4 give c² = 9 + 16 = 25, so c = 5 — the famous 3-4-5 triangle, area 6, perimeter 12 — the default in the tool above.

How it works

Triples. Whole-number sides that satisfy the theorem — 3-4-5, 5-12-13, 8-15-17, and every multiple of them — are called Pythagorean triples. Builders have used the 3-4-5 triple for millennia to lay out true right angles: mark 3 units along one line and 4 along the other, and a 5-unit diagonal confirms the corner is square.

Checking a right angle. The theorem runs both ways: if a² + b² = c² for a triangle's sides, the angle opposite c is a right angle. That is the logic behind the builder's check — and behind this tool refusing a leg that is not shorter than the hypotenuse.

Examples

  • Legs 5 and 12 — c = 13, area 30, the second classic triple.
  • Legs 1 and 1 — c = √2 ≈ 1.4142135624, the diagonal of a unit square, printed as an exact radical.
  • Hypotenuse 13, leg 5 — the other leg is 12 exactly (169 − 25 = 144 = 12²).
  • Legs 1.5 and 2 — c = 2.5: decimals are exact here, not approximations.

Frequently asked questions

Which side is the hypotenuse?

The side opposite the right angle — and always the longest of the three. In the formula it is c, sitting alone on its side of the equation. If you are solving for a missing leg, the longest side you know goes in the hypotenuse box.

Why did the tool refuse my numbers?

Because when solving for a leg, the known leg must be shorter than the hypotenuse. A leg equal to or longer than the hypotenuse would need the other leg to have zero or negative length — geometrically impossible. The refusal states the reason rather than printing a square root of a negative number.

Why does my answer show √ with a decimal beside it?

Most right triangles have an irrational hypotenuse or leg — √2's decimal never terminates. The simplified radical is the exact answer; the decimal beside it (10 places) is for measuring. When the answer is exact, like the 3-4-5 triangle's 5, no radical or approximation appears.

Does this work for triangles that are not right-angled?

No — a² + b² = c² holds only when the angle opposite c is exactly 90°. For a general triangle you need the law of cosines, which the Triangle Calculator on this site applies across all five cases (SSS, SAS, ASA, AAS, SSA).