Pythagorean Theorem Calculator

Find the hypotenuse, a missing leg, or verify a Pythagorean triple for any right triangle.

📐 Pythagorean Theorem Calculator
Leg a
units
Leg b
units

📐 What is the Pythagorean Theorem?

The Pythagorean theorem is one of the most fundamental relationships in all of mathematics. It states that in any right triangle - a triangle containing exactly one 90-degree angle - the square of the length of the hypotenuse (the side opposite the right angle) is equal to the sum of the squares of the other two sides, known as the legs. Expressed as a formula: a² + b² = c², where a and b are the legs and c is the hypotenuse.

The theorem bears the name of the ancient Greek philosopher and mathematician Pythagoras of Samos (c. 570–495 BC), although the relationship was known to Babylonian, Indian, and Chinese mathematicians centuries earlier. The Babylonians used Pythagorean triples as far back as 1900–1600 BC (as seen on the clay tablet Plimpton 322), while the Sulba Sutras of ancient India documented the same relationship around 800–600 BC. What Pythagoras contributed was a formal logical proof within the framework of Greek deductive geometry.

The theorem is foundational to Euclidean geometry and underlies virtually every field of science, engineering, and technology. It is used in architecture to find rafter lengths from a roof's rise and run, in navigation to compute straight-line distances from component directions, in physics to find the magnitude of a resultant vector, in computer graphics to calculate the pixel distance between two points, and in surveying to lay out square corners using the 3-4-5 method. The theorem extends naturally into higher dimensions: in 3D, the space diagonal of a box with dimensions a, b, c is d = √(a² + b² + c²).

This calculator supports three modes: Find Hypotenuse (compute c given both legs a and b), Find Missing Leg (compute one leg given the hypotenuse and the other leg), and Verify Triple (check whether three numbers form a Pythagorean triple). Each mode returns the result along with the triangle area and perimeter where applicable, plus a step-by-step formula note so you can follow the working.

Formulas

Formula 1 - Find the Hypotenuse (c):

c = √(a² + b²)
a = Length of leg a (one of the two shorter sides)
b = Length of leg b (the other shorter side)
c = Hypotenuse (the longest side, opposite the right angle)

Square both legs, add the results together, then take the positive square root. Example: legs 3 and 4 give c = √(9 + 16) = √25 = 5.

Formula 2 - Find a Missing Leg (a):

a = √(c² − b²)
c = Hypotenuse (must be the longest side)
b = The known leg
a = The missing leg to be found

Rearrange the theorem by subtracting b² from both sides: c² − b² = a², then take the square root. The known leg must be strictly shorter than the hypotenuse, otherwise the calculation is undefined.

Formula 3 - Find a Missing Leg (b):

b = √(c² − a²)
c = Hypotenuse
a = The known leg
b = The missing leg to be found

Identical rearrangement, solving for the other leg. Example: hypotenuse 13, known leg 5 gives b = √(169 − 25) = √144 = 12.

Additional results - Area and Perimeter:

Area = ½ × a × b     Perimeter = a + b + c
For a right triangle the two legs are perpendicular, so one leg is the base and the other is the height of the triangle.

How to Use This Calculator

  1. Choose your calculation mode — click Find Hypotenuse if you know both legs, Find Missing Leg if you know the hypotenuse and one leg, or Verify Triple to check whether three numbers satisfy a² + b² = c².
  2. Enter your values — type the known side lengths into the input fields. All values must be positive numbers. For Verify Triple mode you can enter the three sides in any order; the calculator automatically sorts them.
  3. Click Calculate — press the Calculate button to instantly see the missing side (or triple verdict), along with the triangle area, perimeter, and a step-by-step formula note in the grey box.
  4. Share or revisit — use Copy Link to generate a permalink with your exact inputs pre-filled, so you can share the calculation or return to it later.

Example Calculations

Example 1 — Find the Hypotenuse of a 3-4-5 Triangle

Right triangle with legs a = 3 and b = 4

1
Apply the formula: c = √(a² + b²) = √(3² + 4²)
2
c = √(9 + 16) = √25 = 5
3
Area = ½ × 3 × 4 = 6 sq units  ·  Perimeter = 3 + 4 + 5 = 12 units
Hypotenuse = 5.0000 units  ·  Area = 6.0000 sq units  ·  Perimeter = 12.0000 units
Try this example →

Example 2 — Find a Missing Leg (Hypotenuse 13, Leg 5)

Right triangle: hypotenuse c = 13, known leg = 5, find the missing leg

1
Rearrange: missing leg = √(c² − known²) = √(13² − 5²)
2
= √(169 − 25) = √144 = 12
3
Area = ½ × 5 × 12 = 30 sq units  ·  Perimeter = 5 + 12 + 13 = 30 units
Missing Leg = 12.0000 units  ·  Area = 30.0000 sq units  ·  Perimeter = 30.0000 units
Try this example →

Example 3 — Verify the 5-12-13 Pythagorean Triple

Are 5, 12, and 13 a Pythagorean triple?

1
Sort the sides: smallest = 5, middle = 12, largest = 13
2
Compute a² + b² = 5² + 12² = 25 + 144 = 169
3
Compute c² = 13² = 169  ·  Since 169 = 169, it is a Pythagorean triple ✓
Is Pythagorean Triple: Yes ✓  ·  a² + b² = 169  ·  c² = 169
Try this example →

Example 4 — Construction Check with 6-8-10 (Scaled 3-4-5)

Builder's right-angle check: legs a = 6 and b = 8 - what must the diagonal be?

1
c = √(6² + 8²) = √(36 + 64) = √100 = 10
2
The 6-8-10 triple is a 3-4-5 triple scaled by 2. Any scaling of a Pythagorean triple is also a triple.
3
If the diagonal measures exactly 10 units, the corner is a perfect right angle.
Hypotenuse = 10.0000 units  ·  Area = 24.0000 sq units  ·  Perimeter = 24.0000 units
Try this example →

Frequently Asked Questions

What is the Pythagorean theorem and how does it work?+
The Pythagorean theorem states that in any right triangle, the square of the hypotenuse (the side opposite the 90° angle) equals the sum of the squares of the other two sides (the legs): a² + b² = c². It was known to Babylonian and Indian mathematicians over 2,500 years ago and formally proven by Pythagoras of Samos around 570–495 BC. The theorem is foundational to all of Euclidean geometry.
How do I find the hypotenuse of a right triangle?+
Square both legs, add them together, then take the square root. Formula: c = √(a² + b²). Example: legs 3 and 4 give c = √(9 + 16) = √25 = 5. This works for any right triangle regardless of size or units.
How do I find a missing leg of a right triangle?+
Rearrange the theorem: a = √(c² − b²) where c is the hypotenuse and b is the known leg. Example: hypotenuse 13, one leg 5 gives missing leg = √(169 − 25) = √144 = 12. The leg must always be shorter than the hypotenuse.
What are Pythagorean triples?+
Pythagorean triples are sets of three positive integers that satisfy a² + b² = c². The smallest is 3-4-5 (9 + 16 = 25). Other common triples include 5-12-13, 8-15-17, 7-24-25, and 20-21-29. Any multiple of a triple (e.g. 6-8-10, 9-12-15) is also a triple. There are infinitely many Pythagorean triples.
Can the Pythagorean theorem be used in 3D?+
Yes. The 3D extension is: d = √(a² + b² + c²) for the space diagonal of a cuboid (rectangular box). For a cuboid with dimensions 3×4×12, the space diagonal = √(9 + 16 + 144) = √169 = 13. The theorem is applied in two steps: find the floor diagonal first, then apply it again with the height.
What is the converse of the Pythagorean theorem?+
The converse states: if a² + b² = c² for the sides of a triangle, then the triangle must be a right triangle with the right angle opposite side c. This is used in construction to verify 90° corners (3-4-5 method) and to classify triangles. If a² + b² is greater than c² the triangle is acute; if a² + b² is less than c² it is obtuse.
How was the Pythagorean theorem proven?+
Over 370 proofs exist. The classic geometric proof arranges four copies of the right triangle inside a large square to show that the area of the outer square (c²) equals the combined areas of the two inner squares (a² + b²). President James Garfield published a unique proof using a trapezoid in 1876. The theorem also follows directly from the dot product definition in linear algebra.
What is the Pythagorean theorem used for in real life?+
Construction (checking corners are square using 3-4-5), navigation (finding straight-line distances from north-south and east-west components), architecture (rafter length from rise and run), surveying, physics (resultant vector magnitude), computer graphics (pixel distance calculations), and engineering. It is one of the most applied formulas in all of science and engineering.
Does the Pythagorean theorem work for all triangles?+
No. It only applies to right triangles (triangles with exactly one 90° angle). For non-right triangles, use the Law of Cosines: c² = a² + b² − 2ab times cos(C). The Pythagorean theorem is the special case of the Law of Cosines when angle C = 90° (since cos 90° = 0).
What is the difference between legs and hypotenuse in a right triangle?+
The two sides that form the right angle are called legs (or catheti), labelled a and b. The side opposite the right angle - always the longest side - is the hypotenuse, labelled c. In the 3-4-5 triangle, 3 and 4 are legs and 5 is the hypotenuse. The hypotenuse is always longer than either individual leg but shorter than their sum.