Math calculator

Free Pythagorean theorem calculator

Solve right triangles using the Pythagorean theorem — enter any two sides to find the third: a² + b² = c², updated live, as you type.

InputsLive
What to find
Leg a
One of the two legs of the right triangle.
Leg b
The other leg of the right triangle.
How the result is calculated
The Pythagorean theorem states that in any right triangle:c = √(a² + b²)where a and b are the legs and c is the hypotenuse (the side opposite the right angle).
Result
Hypotenuse
5
c = √(a² + b²) = 5
Leg a3
Leg b4
Hypotenuse5
Triangle area6

a² + b² = c². Source: Euclid’s Elements.

Results are estimates. Consult a professional.

How it's calculated

How the Pythagorean theorem calculator works

The Pythagorean theorem states that in any right triangle, the square of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the other two sides. The calculator solves for any one side when the other two are known.

Core theorem:
+=
Solve for hypotenuse c:
c = √(a² + b²)
Solve for leg a (or b by symmetry):
a = √(c² b²)
Euclid's Elements, Book I, Proposition 47 (300 BCE) — first rigorous proof
Example

Worked example: legs 6 and 8

Example: a = 6, b = 8, find hypotenuse c

A right triangle has legs of length 6 and 8. This is a scaled version of the classic 3-4-5 triple (×2).

=+
=+
= 36 + 64
= 100
c = √100 = 10
c = 10
The hypotenuse is exactly 10 — a perfect integer result because 6-8-10 is a Pythagorean triple.
Quick reference

Common Pythagorean triples

Pythagorean triples are sets of three positive integers that satisfy a² + b² = c². Memorising the primitive triples (where GCF = 1) lets you recognise right triangles instantly.

abcType
345Primitive
68103-4-5 × 2
51213Primitive
81517Primitive
72425Primitive
94041Primitive
1024265-12-13 × 2
202129Primitive
123537Primitive
116061Primitive

Source: standard list of Pythagorean triples; verify with a² + b² = c²

Practical tips

Tips for applying the Pythagorean theorem

The theorem appears in architecture, navigation, engineering, and video games. These tips help you apply it without errors.

  • Identify the hypotenuse first — it is always opposite the 90° angle and is the longest side; mislabelling it is the most common mistake.
  • Recognise scaled triples — if two sides have a 3:4 ratio (or 5:12, or 8:15), the third side completes a triple; no calculation needed.
  • Use it in 3D with two steps — to find the space diagonal of a box (l × w × h), first find the floor diagonal d = √(l²+w²), then apply again: space diagonal = √(d²+h²).
  • Converse test for right angles — if a² + b² = c² for three sides, the triangle must contain a right angle; useful for checking whether a corner is truly square in construction.
  • Distance formula is Pythagoras in disguise — the distance between points (x₁,y₁) and (x₂,y₂) is √((x₂−x₁)² + (y₂−y₁)²), which is just the hypotenuse of a right triangle.
Accuracy & limits

Accuracy and limitations

The Pythagorean theorem applies only to right triangles in flat (Euclidean) geometry. On curved surfaces — such as Earth's surface in navigation or on a globe — the theorem does not hold; use spherical trigonometry instead. Results are computed using IEEE 754 double-precision square root, which is accurate to approximately 15 significant digits. For irrational results (e.g. √2, √5) the calculator returns a decimal approximation; for exact symbolic answers use a computer algebra system.

Glossary

Key terms

The longest side of a right triangle; the side opposite the 90° angle.
Either of the two shorter sides of a right triangle that form the right angle.
An angle of exactly 90°; the defining feature of a right triangle.
A set of three positive integers (a, b, c) satisfying a² + b² = c² exactly, with no remainder.
A Pythagorean triple where GCF(a, b, c) = 1; all other triples are multiples of a primitive triple.
Flat-plane geometry in which the Pythagorean theorem holds; contrasted with spherical or hyperbolic geometry.
About

About this calculator

Part of our math calculators suite — explore all calculators.

Questions

Frequently asked questions about the free Pythagorean theorem calculator

A pythagorean theorem calculator is a free online tool that helps you solve a right triangle: find the hypotenuse from two legs, or a missing leg from one leg and the hypotenuse. The Pythagorean theorem relates the three sides of a right triangle. The square of the hypotenuse (longest side) equals the sum of the squares of the two legs. It runs entirely in your browser with instant results and no sign-up.
No. The Pythagorean theorem applies only to right triangles (one 90° angle). For other triangles, use the law of cosines: c² = a² + b² − 2ab·cos(C), which reduces to the Pythagorean theorem when C = 90° (because cos(90°) = 0).
Because in any right triangle, the hypotenuse is opposite the largest angle (90°) and is always the longest side. If you're solving for a missing leg, the hypotenuse you provide must exceed the known leg — otherwise the math gives an imaginary result.
Three positive integers (a, b, c) that satisfy a² + b² = c². Common examples: 3-4-5, 5-12-13, 7-24-25, 8-15-17, 20-21-29. They're useful because they give exact-integer right triangles.

Want a calculator built for your business?

Customize any of our 400+ tools to match your brand, or commission a new one tailored to how your business actually calculates — pricing, payroll, quotes, anything. Deployed on your domain, math runs in your visitors' browsers.