Pythagorean Theorem Calculator

a² + b² = c²
²+
²=
Try:
Hypotenuse c
-
-

🔢 Pythagorean Triples

Pythagorean triples are sets of three integers (a, b, c) where a² + b² = c². Click any triple to calculate it.

Generate Triples

Using Euclid's formula: choose m > n > 0 to generate a primitive triple.

Real-World Applications

Pythagorean Theorem - Full Guide

The Theorem

In a right triangle, the square of the hypotenuse equals the sum of squares of the other two sides.

a² + b² = c²

Where: a, b = legs (shorter sides)
c = hypotenuse (longest side, opposite 90°)

Finding c: c = √(a² + b²)
Finding a: a = √(c² - b²)
Finding b: b = √(c² - a²)

Euclid's Formula for Pythagorean Triples

For any m > n > 0, this generates a Pythagorean triple:

a = m² - n²
b = 2mn
c = m² + n²

Example: m=2, n=1
a = 4-1 = 3, b = 4, c = 4+1 = 5
(3,4,5) 9+16=25

Distance Formula (Pythagorean Theorem in 2D)

Distance = √((x₂-x₁)² + (y₂-y₁)²)

This IS the Pythagorean theorem! The horizontal
difference is leg a, vertical difference is leg b,
and the straight-line distance is hypotenuse c.

Example: From (1,2) to (4,6):
= √((4-1)² + (6-2)²) = √(9+16) = √25 = 5

3D Pythagorean Theorem

For a box with dimensions l, w, h:
Diagonal = √(l² + w² + h²)

Example: 3×4×5 box:
Diagonal = √(9+16+25) = √50 = 5√2 ≈ 7.07

Right Triangle Trigonometry

sin(A) = a/c = opposite/hypotenuse
cos(A) = b/c = adjacent/hypotenuse
tan(A) = a/b = opposite/adjacent

Pythagorean identity: sin²(A) + cos²(A) = 1
(This is just a²/c² + b²/c² = (a²+b²)/c² = c²/c² = 1)

Who Was Pythagoras?

Pythagoras of Samos (570-495 BCE) was a Greek
philosopher and mathematician. However, the theorem
was known to Babylonians ~1000 years earlier!

The Plimpton 322 clay tablet (1800 BCE) lists
15 Pythagorean triples, including 13320-13500-18541.

Egyptian rope-stretchers used the 3-4-5 triple
to create right angles for pyramid construction.

Frequently Asked Questions

The Pythagorean Theorem: in any right triangle, a² + b² = c², where c is the hypotenuse (longest side, opposite the 90° angle) and a, b are the two legs. To find the hypotenuse: c = √(a² + b²). Example: a=3, b=4 → c = √(9+16) = √25 = 5. To find a missing leg: a = √(c² − b²). The theorem only applies to right triangles - triangles with one angle equal to exactly 90°.
The hypotenuse is the longest side of a right triangle, always located opposite the 90° (right) angle. It is labelled c in the formula a² + b² = c². The hypotenuse is always longer than either leg. Formula: c = √(a² + b²). Example: legs 5 and 12 → hypotenuse = √(25 + 144) = √169 = 13. The hypotenuse can never be larger than the sum of the legs (but must be larger than either individual leg).
Pythagorean triples are sets of three positive integers (a, b, c) where a² + b² = c² exactly. Common triples: (3,4,5) - most famous; (5,12,13); (8,15,17); (7,24,25); (20,21,29). Multiples also work: (6,8,10), (9,12,15). A 'primitive triple' shares no common factor. Euclid's formula generates all primitives: for any m > n > 0, a = m²−n², b = 2mn, c = m²+n². Example: m=2, n=1 → (3,4,5). m=3, n=2 → (5,12,13).
Rearrange the theorem: a = √(c² − b²) or b = √(c² − a²). You need the hypotenuse and the other leg as inputs. Example 1: hypotenuse 17, one leg 8 → other leg = √(17² − 8²) = √(289 − 64) = √225 = 15. Example 2: hypotenuse 13, one leg 5 → other leg = √(169 − 25) = √144 = 12. Remember: the hypotenuse must be larger than either leg for the triangle to be valid.
The 3-4-5 method: from a corner, measure 3 units along one wall and 4 units along the other. If the diagonal between those marks is exactly 5 units, the corner is perfectly square (90°). Builders scale this: 6-8-10, 9-12-15, 30-40-50 for larger structures. Rafter length calculation: using the run (horizontal) and rise (vertical) to find hypotenuse (rafter). Staircase: total run and rise determine the staircase length. Diagonal cross-bracing: calculating brace length from height and width.
For any integers m > n > 0: a = m² − n², b = 2mn, c = m² + n². This generates all primitive Pythagorean triples (and all others via scaling). Examples: m=2, n=1 → a=3, b=4, c=5. m=3, n=2 → a=5, b=12, c=13. m=4, n=1 → a=15, b=8, c=17. m=4, n=3 → a=7, b=24, c=25. For primitive triples, m and n must be coprime and not both odd. The formula was known to ancient Greek mathematicians and generates infinitely many triples.
Yes - the space diagonal of a rectangular box with dimensions l, w, h is: d = √(l² + w² + h²). It's applied twice: base diagonal = √(l² + w²), then space diagonal = √(base² + h²) = √(l² + w² + h²). Example: a 3m × 4m × 12m box: d = √(9 + 16 + 144) = √169 = 13m. Applications: maximum rod length that fits in a shipping box, acoustic room diagonal measurements, 3D distance calculations in computer graphics and game engines.
Over 370 documented proofs - more than any other mathematical theorem. The most famous include: Euclid's geometric proof (Book I, Proposition 47 of Elements). The rearrangement proof: four identical right triangles around a square. The similar triangles proof: altitude drawn from the right angle to the hypotenuse creates two triangles similar to each other and the original. US President James Garfield independently discovered a novel proof using trapezoids in 1876 while serving in Congress. The theorem has been proven algebraically, geometrically, using calculus, and through vectors.

Pythagorean Theorem Calculator - Understanding a² + b² = c²

The Pythagorean theorem is one of the oldest and most widely applied results in mathematics - documented in ancient Egypt, Babylon, India, and China, and formally proven by the ancient Greeks. Despite being over 2,500 years old, it remains in daily use everywhere from construction sites to satellite navigation systems.

The three calculations: Find hypotenuse: c = √(a² + b²). Example: a=3, b=4 c = √(9+16) = √25 = 5. Find leg a: a = √(c² − b²). Example: c=13, b=5 a = √(169−25) = √144 = 12. Find leg b: b = √(c² − a²). The theorem only applies when one angle is exactly 90°.

Common Pythagorean Triples - The Numbers That Always Work

Pythagorean triples are sets of positive integers (a, b, c) where a² + b² = c² exactly - no decimals, perfect whole numbers. They're used in construction and engineering where exact integer measurements are convenient:

Primitive Triples (Cannot Be Reduced)

  • 3, 4, 5 - 9 + 16 = 25 Most famous and widely used
  • 5, 12, 13 - 25 + 144 = 169
  • 8, 15, 17 - 64 + 225 = 289
  • 7, 24, 25 - 49 + 576 = 625
  • 20, 21, 29 - 400 + 441 = 841
  • 9, 40, 41 - 81 + 1600 = 1681

Multiples of Primitive Triples

  • 6, 8, 10 - (3,4,5) × 2
  • 9, 12, 15 - (3,4,5) × 3
  • 10, 24, 26 - (5,12,13) × 2
  • 15, 36, 39 - (5,12,13) × 3
  • Any multiple of a valid triple is also a triple
  • The (3,4,5) ratio is used universally by builders

The 3-4-5 Method in Construction - How Builders Use the Theorem

The most practical application of Pythagorean triples is checking that corners are perfectly square (exactly 90°) during construction. The method:

  1. From the corner, measure 3 units along one wall and mark the point
  2. Measure 4 units along the other wall and mark that point
  3. Measure the diagonal between the two marks
  4. If the diagonal is exactly 5 units, the corner is perfectly square
  5. If the diagonal is less than 5, the angle is less than 90°. If more than 5, the angle is greater than 90°.

Builders scale this up: 6-8-10, 9-12-15, or even 30-40-50 for large structures. The ratio 3:4:5 always guarantees a right angle regardless of the unit used - metres, feet, or anything else.

Beyond 2D - The 3D Space Diagonal

The Pythagorean theorem extends to three dimensions for calculating the space diagonal of a rectangular box. If a box has dimensions length (l), width (w), and height (h):

Space diagonal = √(l² + w² + h²)

This is derived by applying the theorem twice: the base diagonal = √(l² + w²), then the space diagonal = √(base diagonal² + h²) = √(l² + w² + h²). This is used in shipping (maximum rod length that fits in a box), architecture (room diagonal for acoustics), and computer graphics (bounding box calculations).

Proofs of the Pythagorean Theorem - There Are Over 370

The Pythagorean theorem has more known proofs than any other mathematical theorem - over 370 documented proofs, including one by US President James Garfield in 1876. They range from simple geometric rearrangements to algebraic proofs to proofs using calculus. The most visually intuitive: arrange four identical right triangles around a square, and the remaining area in two different configurations both equal the areas of the squares on the legs - proving a² + b² = c².

How this calculator works, and where the numbers come from

The Pythagorean Theorem applies the standard formula for this calculation to the values you enter and updates the result as you type. The calculation itself happens in your browser, and the page explains the method so you can check any result by hand.

Please note: Results are provided for general information and are calculated from the values you enter.

Sources and further reading

Last reviewed: by the CalcQube Editorial Team. See our editorial policy for how we build and check calculators, or report an error.