Enter any two sides — a (leg), b (leg) or c (hypotenuse) — and the third is calculated instantly.

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

Formulas of the Pythagorean Theorem

In a right triangle with legs a, b and hypotenuse c:

a2 + b2 = c2
  • c= a2+b2 — find the hypotenuse from the two legs
  • a= c2b2 — find leg a from c and b
  • b= c2a2 — find leg b from c and a

An application: calculating the diagonal of a square

For a square with side a, both legs are equal (a = b). The diagonal is:

c = a2+a2 = 2a2 = a2 1.414×a

Frequently Asked Questions

The Pythagorean theorem states that in any right triangle, the square of the hypotenuse (the longest side, opposite the right angle) equals the sum of the squares of the two legs: a² + b² = c². Named after the Greek philosopher Pythagoras (c. 570–495 BC), it is one of the most fundamental relationships in mathematics, already known to ancient Babylonian and Indian mathematicians.
To find the hypotenuse c when you know both legs a and b, use c = √(a² + b²). Square each leg, add the results, then take the square root. For example, a = 3 cm and b = 4 cm gives c = √(9 + 16) = √25 = 5 cm. The 3-4-5 triangle is the most famous Pythagorean triple.
To find leg a when you know leg b and hypotenuse c, rearrange the formula: a = √(c² − b²). For example, if c = 13 and b = 12: a = √(169 − 144) = √25 = 5. Important: the hypotenuse must always be strictly greater than either leg. If c ≤ b, no real solution exists.
No — it applies only to right triangles (triangles with exactly one 90° angle). For other triangles, the law of cosines generalises the relationship: c² = a² + b² − 2ab·cos(C). When C = 90°, cos(C) = 0 and the formula reduces to the Pythagorean theorem. Conversely, if a² + b² = c², the triangle must be a right triangle. See also our triangle calculator.
In construction, the 3-4-5 triangle squares corners. In navigation, it calculates straight-line distances between two points. In carpentry, it determines diagonal brace lengths. In screen technology, the advertised diagonal of a monitor is computed from its width and height. In GPS, 3D distance calculations extend the same principle.


Send your feedback