CalculatorSwitch
Calculator Switch
Math

Pythagorean Theorem Calculator

Last updated:

How to Use This Calculator

Step 1: Choose what to solve for — the hypotenuse c, or one of the legs a or b.

Step 2: Enter the two known side lengths.

Step 3: Click Calculate to see the missing side along with the triangle's area and perimeter.

What Is the Pythagorean Theorem?

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. It applies only to right triangles — triangles with one 90-degree angle.

It is one of the oldest and most important theorems in mathematics, attributed to the ancient Greek mathematician Pythagoras (around 500 BCE), though the relationship was known in Babylonian and Indian mathematics centuries earlier.

The theorem is used constantly in construction, navigation, physics, computer graphics, and any problem involving distance in two dimensions.

The Pythagorean Formula

a² + b² = c²

Where a and b are the two legs (shorter sides) and c is the hypotenuse (longest side, opposite the right angle).

Solving for c: c = √(a² + b²)
Solving for a: a = √(c² − b²)
Solving for b: b = √(c² − a²)

Example: a = 3, b = 4
c² = 9 + 16 = 25
c = √25 = 5 (classic 3-4-5 triangle)

Common Pythagorean Triples

abc
345
51213
81517
72425
94041
202129

Examples

Example 1: Legs 3 and 4 → hypotenuse 5 (the famous 3-4-5 triangle used by builders to square corners).

Example 2: Hypotenuse 13, leg 5 → other leg is 12 (Pythagorean triple 5-12-13).

Example 3: Legs 1 and 1 → hypotenuse √2 ≈ 1.414 (diagonal of a unit square).

Tips

Right triangles only. The theorem fails for non-right triangles.

c is always the longest side — across from the right angle.

Pythagorean triples are whole-number solutions like 3-4-5 and 5-12-13.

Distance formula in coordinate geometry is just the Pythagorean theorem with (x₂−x₁) and (y₂−y₁) as legs.

Frequently Asked Questions

Does the Pythagorean theorem work for non-right triangles?
No. The theorem applies only to right triangles — triangles that contain exactly one 90-degree angle. For non-right triangles, use the Law of Cosines, which is a generalized version: c squared equals a squared plus b squared minus 2ab times the cosine of the angle between a and b. When that angle is 90 degrees, the cosine is zero and the formula reduces to the Pythagorean theorem.
Which side is the hypotenuse?
The hypotenuse is always the side opposite the right angle, which makes it the longest side of any right triangle. If you look at a right triangle and identify the 90-degree corner, the side that does not touch that corner is the hypotenuse. It is labeled 'c' by convention, with the two shorter sides — the legs — labeled 'a' and 'b'.
What are Pythagorean triples?
Pythagorean triples are sets of three positive integers that satisfy a squared plus b squared equals c squared. The most famous is 3-4-5, because 9 plus 16 equals 25. Others include 5-12-13, 8-15-17, and 7-24-25. Ancient builders used the 3-4-5 triple to construct perfect right angles — by measuring a rope knotted at 3, 4, and 5 units, you can lay out a guaranteed square corner. There are infinitely many Pythagorean triples.
How is the Pythagorean theorem used in real life?
It is one of the most widely used theorems in practice. Carpenters use it to square building foundations. Surveyors calculate distances across terrain. GPS systems compute straight-line distances between coordinates. Computer graphics use it for pixel distance in raytracing. Football coaches use it to measure diagonal field positions. Pilots use it in navigation. Any time you need the straight-line distance between two points in 2D, you are applying this theorem.
What happens if I enter values that do not form a valid right triangle?
When solving for a leg (a or b), the hypotenuse c must be strictly longer than the other known leg — otherwise c squared minus the leg squared would be negative, giving no real solution. The calculator will show an error if you enter inputs that violate this. When solving for the hypotenuse, any two positive leg lengths are valid. Note that just satisfying a squared plus b squared equals c squared does not automatically mean the three values physically form a triangle in the real world at a specific angle — but the math will always work out.
Is there a 3D version of the Pythagorean theorem?
Yes. For a rectangular box with sides a, b, and c, the diagonal d satisfies d squared equals a squared plus b squared plus c squared. This is the three-dimensional distance formula and is used in engineering, physics, and computer graphics. The pattern extends to any number of dimensions: the distance from the origin to a point (x, y, z, w, ...) is the square root of the sum of squares of all the coordinates.

Related Calculators

Was this useful?