📐 Free Math Calculator

Pythagorean Theorem
Calculator

Instantly calculate the hypotenuse or any missing side of a right triangle using the formula a² + b² = c² — with full step-by-step solutions.

✓ Free & Instant ✓ Step-by-Step Solution ✓ Works on Mobile ✓ No Sign-up Needed

Enter Known Values

units
units
b a c 90°?

a² + b² = c²

c = √(a²+b²)
Find Hypotenuse
a = √(c²−b²)
Find Leg a
b = √(c²−a²)
Find Leg b

Common Pythagorean Triples

Whole-number solutions to a² + b² = c²

a b c (Hypotenuse) Verification
3459 + 16 = 25 ✓
5121325 + 144 = 169 ✓
8151764 + 225 = 289 ✓
7242549 + 576 = 625 ✓
9404181 + 1600 = 1681 ✓
202129400 + 441 = 841 ✓
116061121 + 3600 = 3721 ✓
681036 + 64 = 100 ✓

What Is the Pythagorean Theorem?

The Pythagorean Theorem is one of the most fundamental and widely-used principles in all of mathematics. It establishes a definitive relationship between the three sides of a right triangle — a triangle that contains exactly one 90-degree (right) angle. Simply stated, the theorem says:

"In a right triangle, the square of the length of the hypotenuse is equal to the sum of the squares of the lengths of the other two sides."

In equation form, this is expressed as:

a² + b² = c²

Where a and b represent the lengths of the two legs (the sides that form the right angle), and c represents the length of the hypotenuse (the side opposite the right angle — always the longest side).

This elegantly simple relationship has profound implications across geometry, trigonometry, algebra, calculus, physics, engineering, computer science, and virtually every branch of applied mathematics. Understanding this theorem — truly understanding it — opens a gateway to comprehending how distances and shapes work in our physical world.

The theorem is named after the ancient Greek philosopher and mathematician Pythagoras of Samos, though as we'll explore in the history section, knowledge of this relationship predates him by many centuries across several civilizations.

The Formula Explained in Detail

Let's break down the formula a² + b² = c² piece by piece so you have a crystal-clear understanding of what each variable represents and how to use it.

The Three Sides of a Right Triangle

a
Leg a
One of the two shorter sides that forms the right angle. Adjacent to the 90° corner.
b
Leg b
The other shorter side forming the right angle. Together with a, creates the right angle.
c
Hypotenuse c
The longest side, always opposite the right angle. This is what we solve for most often.

The Three Rearrangements

The formula can be algebraically rearranged to solve for any one of the three sides, given that you know the other two:

c = √(a² + b²) Use when you know both legs and need to find the hypotenuse
a = √(c² − b²) Use when you know the hypotenuse and leg b, solving for leg a
b = √(c² − a²) Use when you know the hypotenuse and leg a, solving for leg b

What Does "Squared" Mean Geometrically?

The beauty of the Pythagorean Theorem lies in its geometric interpretation. When we say "a squared", we literally mean the area of a square built on side a. The theorem states that the area of the square on the hypotenuse equals the combined areas of the squares on the two legs. This geometric insight — that areas of squares can sum — is what makes the theorem not just useful but deeply beautiful.

If you draw squares on each side of a right triangle, the two smaller squares (on legs a and b) will have areas that perfectly add up to the area of the largest square (on hypotenuse c). This isn't just algebra — it's a fundamental truth about the geometry of space itself.

History and Origins of the Pythagorean Theorem

The history of the Pythagorean Theorem is a fascinating journey spanning over 4,000 years and multiple civilizations. Despite bearing the name of Pythagoras, the relationship between the sides of a right triangle was understood long before the famous Greek philosopher was born.

Ancient Babylon (c. 1800 BCE)

The oldest known evidence of the theorem comes from ancient Babylon. The clay tablet known as Plimpton 322, dated to approximately 1800 BCE, contains a list of Pythagorean triples — sets of three whole numbers satisfying a² + b² = c². Babylonian mathematicians clearly understood and used this relationship nearly 1,300 years before Pythagoras.

Ancient Egypt

Egyptian builders, particularly those who constructed the Great Pyramids, are believed to have used the 3-4-5 Pythagorean triple to create perfect right angles. Harpedonaptai (rope-stretchers) would tie ropes with 12 equally spaced knots, forming a triangle with sides of length 3, 4, and 5 — guaranteeing a right angle at the corner. This practical application demonstrates deep empirical knowledge of the theorem, even if not formally proven.

Ancient India

Indian mathematicians recorded knowledge of the theorem in the Baudhayana Sulba Sutra (c. 800–600 BCE), which states the theorem in the context of ritual altar construction. This predates Pythagoras by several centuries and includes not only the basic theorem but also specific Pythagorean triples and early approximations of √2.

Ancient China

The ancient Chinese mathematical classic Zhoubi Suanjing (The Arithmetical Classic of the Gnomon and the Circular Paths of Heaven), written roughly around 1100 BCE though possibly later, contains a proof-like description of the theorem — called the Gougu theorem in China. The visual proof in this text resembles what we now call a "Chinese proof" or "rearrangement proof" of the Pythagorean Theorem.

Pythagoras and the Greek Tradition (c. 570–495 BCE)

Pythagoras of Samos was a Greek philosopher, mathematician, and mystic who founded a philosophical and mathematical brotherhood known as the Pythagoreans. While he almost certainly did not discover the relationship, the Pythagorean school is credited with the first known rigorous mathematical proof of the theorem — a deductive logical argument rather than empirical observation.

The Pythagoreans saw mathematics as the underlying order of the universe and believed that everything was reducible to numbers and ratios. Ironically, their own beloved theorem led to the discovery of irrational numbers — numbers that cannot be expressed as simple fractions — because the hypotenuse of a right isosceles triangle with legs of length 1 is √2, which cannot be expressed as a ratio of two integers.

Euclid's Rigorous Proof (c. 300 BCE)

The most famous ancient proof of the Pythagorean Theorem appears in Euclid's Elements (Book I, Proposition 47). Euclid's proof, known as the "windmill proof" due to the shape formed in the diagram, is a masterpiece of geometric reasoning. It uses the properties of congruent triangles and parallelograms to demonstrate the theorem without any algebraic calculation.

Over the centuries, mathematicians have found over 370 different proofs of the Pythagorean Theorem — more than any other theorem in mathematics. This includes proofs by US President James Garfield (1876), Leonardo da Vinci, and even a high-school proof involving trapezoids.

How to Use This Pythagorean Theorem Calculator

Our calculator is designed to be as simple and intuitive as possible. Here is a step-by-step guide:

1
Choose what to solve forClick one of the three tabs at the top: "Solve for c (Hypotenuse)", "Solve for a (Leg)", or "Solve for b (Leg)". This tells the calculator which side is unknown.
2
Enter the two known valuesType the lengths of the two known sides into the input fields. You can use whole numbers, decimals, or even very large or very small numbers — the calculator handles them all.
3
Click "Calculate"Press the orange Calculate button. The result appears instantly, displayed in a clear results box.
4
Review the step-by-step solutionBelow the result, the calculator shows a complete step-by-step breakdown of the calculation, so you can follow along and learn the process.

The "Reset" button clears all inputs so you can start a fresh calculation. All answers are rounded to 4 decimal places for precision.

Worked Examples

Example 1: Find the Hypotenuse

Problem: A right triangle has legs a = 3 and b = 4. Find the hypotenuse c.

c² = a² + b²
c² = 3² + 4²
c² = 9 + 16
c² = 25
c = √25
c = 5

✓ This is the classic 3-4-5 Pythagorean triple. The answer is a perfect integer.

Example 2: Find a Missing Leg

Problem: A right triangle has hypotenuse c = 13 and one leg a = 5. Find leg b.

b² = c² − a²
b² = 13² − 5²
b² = 169 − 25
b² = 144
b = √144
b = 12

✓ The 5-12-13 triple. Verify: 5² + 12² = 25 + 144 = 169 = 13² ✓

Example 3: Non-Integer Answer (Real-World Scenario)

Problem: A ladder leans against a wall. The base of the ladder is 6 feet from the wall and the ladder reaches a height of 8.5 feet up the wall. How long is the ladder?

c² = a² + b²
c² = 6² + 8.5²
c² = 36 + 72.25
c² = 108.25
c = √108.25
c ≈ 10.4043 feet

✓ The ladder is approximately 10.4 feet long. Real-world answers are rarely perfect integers.

Example 4: Unit Conversion Context

Problem: A baseball diamond is a square with each side 90 feet long. How far is it from home plate to second base (the diagonal)?

c² = 90² + 90²
c² = 8100 + 8100
c² = 16200
c = √16200
c ≈ 127.2792 feet

✓ This is the classic "diagonal of a square" application. When both legs are equal, c = a√2.

Pythagorean Triples: A Deep Dive

A Pythagorean triple is a set of three positive integers (a, b, c) such that a² + b² = c². These are the "clean" solutions to the Pythagorean Theorem — situations where all three side lengths are whole numbers.

The simplest and most famous Pythagorean triple is (3, 4, 5). Check: 3² + 4² = 9 + 16 = 25 = 5². Any multiple of a Pythagorean triple is also a Pythagorean triple. So (6, 8, 10), (9, 12, 15), and (300, 400, 500) are all valid triples.

Primitive Pythagorean Triples

A primitive Pythagorean triple is one where gcd(a, b, c) = 1 — the three numbers share no common factor. All primitive triples can be generated using Euclid's formula:

a = m² − n²   |   b = 2mn   |   c = m² + n²

Where m and n are positive integers with m > n, gcd(m, n) = 1, and m − n is odd. For example, m = 2, n = 1 gives: a = 3, b = 4, c = 5. And m = 3, n = 2 gives: a = 5, b = 12, c = 13.

There are infinitely many Pythagorean triples. Some interesting properties: in every primitive triple, exactly one of a or b is even (b in Euclid's formula is always even), c is always odd, and exactly one of a, b is divisible by 3, and exactly one is divisible by 4.

The Converse of the Pythagorean Theorem

The converse of the Pythagorean Theorem is equally powerful: if the square of the longest side of a triangle equals the sum of the squares of the other two sides, then the triangle must be a right triangle.

"If a² + b² = c², then the angle opposite side c is a right angle."

This converse allows us to test whether a triangle is a right triangle, even if we don't see an angle labeled 90°. This is hugely useful in construction, carpentry, and engineering — the ancient Egyptian rope-stretchers were applying exactly this principle.

Extended Classification

The theorem can also tell us whether a triangle is acute or obtuse:

a² + b² = c² Right triangle (90° angle opposite c)
a² + b² < c² Obtuse triangle (angle opposite c is greater than 90°)
a² + b² > c² Acute triangle (all angles less than 90°)

Famous Proofs of the Pythagorean Theorem

With over 370 known proofs, the Pythagorean Theorem holds the record for the most-proved theorem in mathematics. Here are some of the most famous and elegant.

1. The Rearrangement Proof (Chinese/Indian)

This visual proof is among the simplest. Take four identical right triangles with legs a and b. Arrange them to form a large square with side (a + b). The four triangles leave a square hole in the middle with side c. The area of the large square is (a + b)² = a² + 2ab + b². The four triangles have total area 4 × (½ab) = 2ab. Therefore the inner square has area (a + b)² − 2ab = a² + b², proving c² = a² + b².

2. Euclid's Proof (Elements, Book I, Prop. 47)

Euclid's elegant proof constructs three squares on the sides of the right triangle. By drawing a perpendicular from the right angle vertex to the hypotenuse, it divides the square on the hypotenuse into two rectangles. Each rectangle is then shown to have the same area as the square on the corresponding leg. This proof relies solely on the properties of area and congruent triangles, without any algebraic notation.

3. Similar Triangles Proof

When you drop a perpendicular from the right angle to the hypotenuse of a right triangle, you create two smaller triangles, both of which are similar to the original and to each other. Using the properties of similar triangles (corresponding sides are proportional), the relationship a² + b² = c² follows directly. This is one of the most transparent algebraic proofs.

4. President Garfield's Proof (1876)

James A. Garfield, who would later become the 20th President of the United States, devised an elegant proof using a trapezoid. By constructing a trapezoid from two right triangles and computing its area in two ways — once using the trapezoid formula and once by summing the areas of the three constituent triangles — he arrived at the theorem. This proof was published in the New England Journal of Education in 1876, making Garfield the only US president known to have contributed an original mathematical proof.

Extending to 3D: The Space Diagonal Formula

The Pythagorean Theorem extends naturally to three dimensions. To find the distance from one corner of a rectangular box (cuboid) to the diagonally opposite corner, you apply the theorem twice:

d = √(a² + b² + c²)

Where a, b, and c are the three dimensions (length, width, height) of the box. This is derived by applying the 2D Pythagorean Theorem first to the base (getting the floor diagonal √(a² + b²)), then applying it again with the height: d = √((√(a² + b²))² + c²) = √(a² + b² + c²).

Example: A room is 12 m long, 8 m wide, and 3 m tall. The diagonal distance from one corner of the floor to the diagonally opposite corner of the ceiling is: d = √(12² + 8² + 3²) = √(144 + 64 + 9) = √217 ≈ 14.73 m.

This 3D extension underlies the Euclidean distance formula in any number of dimensions, which is the foundation of modern data science, machine learning (measuring distances between data points), and physics (measuring spacetime intervals in special relativity).

Real-Life Applications of the Pythagorean Theorem

The Pythagorean Theorem is not merely a classroom abstraction. It is actively used every day in an enormous range of professions and technologies. Here are some of the most important real-world applications:

🏗️

Architecture & Construction

Builders use the 3-4-5 rule to verify that corners are perfectly square (90°). Staircases, roof rafters, and support beams all rely on right-triangle calculations. The slope of a ramp or the diagonal of a wall cavity requires the theorem.

🧭

Navigation & GPS

GPS satellites triangulate positions using distance calculations based on the Pythagorean Theorem (and its 3D extension). Ship and aircraft navigation has relied on right-triangle geometry for centuries.

💻

Computer Graphics & Gaming

Video game engines calculate distances between objects, detect collisions, and render 3D scenes using the Pythagorean distance formula millions of times per second. Screen pixel distances and collision radii all use a² + b² = c².

Electrical Engineering

In AC circuits, the relationship between resistance (R), reactance (X), and impedance (Z) follows the Pythagorean Theorem: Z² = R² + X². This is fundamental to designing power systems and electronics.

🔭

Astronomy & Physics

Astronomers calculate distances to stars using parallax measurements that involve right-triangle geometry. Physicists use a generalized version (the metric tensor) in special and general relativity to compute spacetime distances.

📐

Surveying & Mapping

Land surveyors use triangulation — a method based entirely on the Pythagorean Theorem and trigonometry — to measure distances and elevations across terrain that cannot be directly measured.

Beyond these practical fields, the Pythagorean Theorem serves as the foundation for trigonometry (defining sine, cosine, and the Pythagorean identity sin²θ + cos²θ = 1), complex number geometry, vector mathematics, and Riemannian geometry.

The Distance Formula: Pythagorean Theorem on a Coordinate Plane

One of the most important algebraic applications of the Pythagorean Theorem is the distance formula, used to find the distance between any two points on a coordinate plane.

Given two points (x₁, y₁) and (x₂, y₂), the distance d between them is:

d = √((x₂−x₁)² + (y₂−y₁)²)

This formula is derived directly from the Pythagorean Theorem. The horizontal difference (x₂ − x₁) is one leg, the vertical difference (y₂ − y₁) is the other leg, and the distance d is the hypotenuse of the right triangle formed.

Example: Find the distance between (2, 1) and (6, 4). d = √((6−2)² + (4−1)²) = √(16 + 9) = √25 = 5.

This formula extends to three dimensions as d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²), and in n dimensions, it becomes the foundation of the Euclidean metric — the standard way of measuring "straight-line" distance in any number of dimensions, used throughout physics, machine learning, and data science.

Tips, Tricks & Common Mistakes

✅ Helpful Tips

💡 Memorize common triples. Knowing that (3,4,5), (5,12,13), and (8,15,17) are triples saves enormous calculation time on tests.
💡 The hypotenuse is always opposite the right angle. If you're unsure which side is c, it's the one across from the 90° box marker.
💡 Units must be consistent. Both legs must be in the same unit (both in feet, both in meters, etc.) before applying the theorem. Convert before calculating.
💡 Use the converse to check your work. After finding the missing side, verify by checking a² + b² = c².

❌ Common Mistakes to Avoid

⚠️ Applying the theorem to non-right triangles. The formula a² + b² = c² ONLY works for right triangles. For other triangles, use the Law of Cosines: c² = a² + b² − 2ab·cos(C).
⚠️ Forgetting to take the square root. After computing c² = 25, students sometimes stop there. Remember: c = √25 = 5, not 25.
⚠️ Adding before squaring. A very common error: √(a² + b²) ≠ a + b. You must square first, then add, then take the root. For example, √(3² + 4²) = √25 = 5, NOT 3 + 4 = 7.
⚠️ Using the wrong formula when solving for a leg. When solving for a leg, use subtraction: b = √(c² − a²). A common mistake is to add: b = √(c² + a²), which gives a wrong answer.
⚠️ Getting a negative value under the square root. If c² − a² is negative, you've assigned c and a incorrectly. The hypotenuse c must always be the largest side.

Frequently Asked Questions

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: a² + b² = c². It is one of the most fundamental relationships in geometry and mathematics.
To find the hypotenuse c, use c = √(a² + b²). Square both legs, add the results, and take the square root. Example: if a = 3 and b = 4, then c = √(9 + 16) = √25 = 5.
No. The Pythagorean Theorem applies only to right triangles — triangles with exactly one 90-degree angle. For non-right triangles, you need to use the Law of Cosines: c² = a² + b² − 2ab·cos(C), where C is the angle opposite side c.
Pythagorean triples are sets of three positive integers (a, b, c) where a² + b² = c². Common examples are (3,4,5), (5,12,13), (8,15,17), (7,24,25), and (20,21,29). Any multiple of a triple is also a triple — e.g., (6,8,10), (9,12,15). There are infinitely many Pythagorean triples.
The theorem is named after Pythagoras of Samos (c. 570–495 BCE), a Greek mathematician who is credited with the first formal proof. However, the relationship was known much earlier — Babylonian mathematicians documented it circa 1800 BCE, and ancient Indian and Chinese texts describe it independently. Pythagoras (or his school) formalized it as a proven theorem.
The converse states: if the sides of a triangle satisfy a² + b² = c², then it must be a right triangle with the 90° angle opposite c. This lets you test whether any triangle is a right triangle without measuring angles — just measure the sides.
Yes! In 3D space, the distance between two points or the diagonal of a rectangular box uses the extended formula: d = √(a² + b² + c²). This is derived by applying the 2D theorem twice. In n dimensions, the formula extends to d = √(x₁² + x₂² + ... + xₙ²).
The Pythagorean Theorem is the foundation of trigonometry. Dividing the equation a² + b² = c² by c² gives (a/c)² + (b/c)² = 1, which becomes sin²θ + cos²θ = 1 — the fundamental Pythagorean trigonometric identity. All other trig identities can be derived from this one.