Pythagorean Theorem Calculator Icon

Pythagorean Theorem Calculator

Find any missing side of a right triangle using a² + b² = c²

  • Created by John Harris
  • Reviewed by Ramesh Agarwal
  • Last updated 29th April 2026

Missing Side

Working

Triangle Area

Perimeter

a² + b² = c²

The Pythagorean theorem is one of the oldest and most useful results in all of mathematics. In any right triangle, the square of the hypotenuse equals the sum of the squares of the two legs. Once you know two sides of a right triangle, the third is just an algebraic step away.

The Pythagorean theorem formula

For any right triangle with legs a and b and hypotenuse c:

a² + b² = c²

The hypotenuse is always the longest side and is always opposite the 90° angle. The two legs are the sides that form the right angle. To find any one of the three sides given the other two, rearrange the formula:

c = √(a² + b²)   (find the hypotenuse)
a = √(c² − b²)   (find leg a)
b = √(c² − a²)   (find leg b)

This calculator handles all three cases — choose what you want to solve for and enter the other two sides.

Example: finding the hypotenuse

A right triangle has legs of 6 and 8. To find the hypotenuse:

c = √(6² + 8²) = √(36 + 64) = √100 = 10

This is the classic 6-8-10 triangle — a scaled-up version of the famous 3-4-5 triangle. Both are examples of Pythagorean triples, where all three sides are whole numbers.

Example: finding a missing leg

A right triangle has hypotenuse 13 and one leg of 5. To find the other leg:

b = √(13² − 5²) = √(169 − 25) = √144 = 12

This is the well-known 5-12-13 triangle. Note: when solving for a leg, the hypotenuse must be larger than the known leg — otherwise the value under the square root becomes negative, meaning no such right triangle exists.

Real-world uses of the Pythagorean theorem

The Pythagorean theorem might be one of the most-used pieces of math outside the classroom. Carpenters and builders use the "3-4-5 method" to lay out perfect square corners on foundations and decks: measure 3 feet along one wall, 4 feet along the perpendicular wall, and the diagonal between those marks should be exactly 5 feet if the corner is truly square.

Roofers use it to calculate rafter lengths from rise and run. Surveyors use it for direct-distance measurements. Pilots and sailors use it for navigation. In any field where right angles and straight-line distances appear — which is most of them — the Pythagorean theorem shows up.

The distance formula and the Pythagorean theorem

The distance formula in coordinate geometry is just the Pythagorean theorem in disguise. The distance between two points (x₁, y₁) and (x₂, y₂) is √((x₂−x₁)² + (y₂−y₁)²). The horizontal distance and vertical distance form the two legs of a right triangle, and the straight-line distance between the points is the hypotenuse. Every distance calculation in 2D coordinate space is fundamentally Pythagoras.

Common Pythagorean triples

A Pythagorean triple is a set of three integers (a, b, c) that satisfy a² + b² = c². Memorizing a few makes mental math much easier:

3, 4, 5
5, 12, 13
8, 15, 17
7, 24, 25
20, 21, 29

Any multiple of a Pythagorean triple is also a triple — (6, 8, 10), (9, 12, 15), (15, 20, 25) are all variants of (3, 4, 5).

What about non-right triangles?

The Pythagorean theorem applies only to right triangles. For any other triangle, use the more general Law of Cosines: c² = a² + b² − 2ab·cos(C), where C is the angle opposite side c. When C is exactly 90°, cos(C) = 0 and the formula reduces to a² + b² = c² — the Pythagorean theorem is just a special case of the Law of Cosines.

FAQs

The Pythagorean theorem states that in a right triangle, the square of the length of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the lengths of the other two sides. The formula is a² + b² = c², where c is the hypotenuse and a and b are the two legs. It applies only to right triangles — those with one 90° angle.

Square each leg, add them together, and take the square root. The formula is c = √(a² + b²). For example, if the legs are 3 and 4, then c = √(9 + 16) = √25 = 5. The classic 3-4-5 triangle is the simplest Pythagorean triple.

Rearrange the formula: a = √(c² − b²) or b = √(c² − a²). For example, if the hypotenuse is 13 and one leg is 5, the other leg is √(169 − 25) = √144 = 12. Note that c must be larger than either leg — otherwise no right triangle with those measurements exists.

A Pythagorean triple is a set of three positive integers (a, b, c) that satisfy a² + b² = c². The smallest is (3, 4, 5). Other common triples include (5, 12, 13), (8, 15, 17) and (7, 24, 25). Any triple can be scaled — for example, (6, 8, 10) is just (3, 4, 5) doubled. Pythagorean triples make right-triangle problems much cleaner because all three sides come out as integers.

No — it only works for right triangles, those with one 90° angle. For non-right triangles, you need the more general Law of Cosines: c² = a² + b² − 2ab·cos(C), where C is the angle opposite side c. The Pythagorean theorem is actually a special case of the Law of Cosines when C = 90° (because cos(90°) = 0).

Construction and carpentry use it constantly — to check that corners are square (the 3-4-5 trick) and to calculate roof rafters, stair stringers and diagonal bracing. Surveying, navigation and GPS calculations rely on it for distance between points. In computer graphics, it's used to compute the distance between two pixels. Even physics — like calculating the resultant of perpendicular forces — depends on it.