Skip to content
Explore tools

Geometry

Pythagorean Theorem: Formula, Proofs And Real Examples

Last updated: October 2026

The Pythagorean theorem says that in a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides: a² + b² = c². For example, a right triangle with legs of 3 and 4 has a hypotenuse of 5, because 3² + 4² = 9 + 16 = 25, and √25 = 5.

This guide explains the formula, shows how to use it, walks through four proofs, and covers the converse, Pythagorean triples and real-world uses.

What Is The Pythagorean Theorem?

The Pythagorean theorem is a rule about right triangles, which are triangles with one 90° angle. It says the two shorter sides, squared and added together, equal the longest side squared.

A right triangle has three named sides:

SideWhat it isLetter
LegsThe two sides that form the right anglea and b
HypotenuseThe longest side, across from the right anglec

The theorem only works for right triangles. For a triangle with no 90° angle, a² + b² will not equal c², and you need a different rule, covered later in this guide.

The picture behind the formula: build a square on each side of a right triangle. The area of the big square on the hypotenuse equals the areas of the two smaller squares on the legs added together. With sides 3, 4 and 5, the squares have areas 9, 16 and 25, and 9 + 16 = 25.

The Pythagorean Theorem Formula

The main formula is a² + b² = c². You can rearrange it to find any missing side.

To findFormula
Hypotenuse cc = √(a² + b²)
Leg aa = √(c² − b²)
Leg bb = √(c² − a²)

Rule of thumb: to find the hypotenuse, add the squares. To find a leg, subtract the smaller square from the larger one.

How To Use The Pythagorean Theorem: Worked Examples

Every problem follows the same steps: label the sides, plug them into the right formula, then take a square root. These examples cover the most common types.

Finding The Hypotenuse

Example: the legs are 6 and 8.

  1. Square the legs: 6² = 36 and 8² = 64.
  2. Add: 36 + 64 = 100.
  3. Take the square root: √100 = 10.

Finding A Missing Leg

Example: the hypotenuse is 13 and one leg is 5.

  1. Square both: 13² = 169 and 5² = 25.
  2. Subtract: 169 − 25 = 144.
  3. Take the square root: √144 = 12.

When The Answer Is Not A Whole Number

Most real triangles do not give neat answers. Example: the legs are 5 and 7.

  1. 5² + 7² = 25 + 49 = 74.
  2. c = √74 ≈ 8.602.

Leave it as √74 for exact answers, or round for measurements. For quick answers with any numbers, the Pythagorean theorem calculator shows each step.

Sides Written With Variables

Some problems give the sides as expressions. Example: the legs are x and x + 7, and the hypotenuse is x + 8.

  1. Write the equation: x² + (x + 7)² = (x + 8)².
  2. Expand: x² + x² + 14x + 49 = x² + 16x + 64.
  3. Simplify: x² − 2x − 15 = 0.
  4. Factor: (x − 5)(x + 3) = 0, so x = 5 or x = −3.
  5. A side cannot be negative, so x = 5, and the sides are 5, 12 and 13.

Step 3 is a quadratic equation. If it does not factor easily, the quadratic equation solver finds the roots.

Pythagorean Theorem Proofs

There are hundreds of known proofs of the Pythagorean theorem. Elisha Loomis collected 367 of them in his book The Pythagorean Proposition. Here are four of the clearest, each using a different idea. Euclid's version, in Book I, Proposition 47 of his Elements, is the most famous, but these are easier to follow.

Proof 1: Rearranging Four Triangles

This proof compares the area of one big square measured two different ways.

  1. Make a large square with sides of length a + b.
  2. Place four copies of the right triangle inside it, one in each corner, so their hypotenuses form a tilted square in the middle. That inner square has side c.
  3. Area of the big square, way 1: (a + b)² = a² + 2ab + b².
  4. Area of the big square, way 2: four triangles plus the inner square: 4 × (½ab) + c² = 2ab + c².
  5. Set them equal: a² + 2ab + b² = 2ab + c².
  6. Subtract 2ab from both sides: a² + b² = c².

Proof 2: The Square Inside A Square

This version appears in an ancient Chinese text, the Zhoubi Suanjing, and uses the same four triangles arranged the other way.

  1. Arrange the four triangles inside a square of side c, with their hypotenuses on the outside edges.
  2. A small square is left in the middle. Its side is b − a.
  3. Area of the big square: c².
  4. Area of the pieces: 4 × (½ab) + (b − a)² = 2ab + b² − 2ab + a² = a² + b².
  5. So c² = a² + b².

Proof 3: Similar Triangles

This proof uses the fact that a right triangle splits into two smaller triangles with the same shape.

  1. Draw a line from the right angle straight down to the hypotenuse. This height splits c into two parts, p and q, so p + q = c.
  2. The two small triangles are similar to the original triangle, because they share its angles.
  3. Similar triangles have matching ratios. That gives a ÷ c = p ÷ a, so a² = cp. In the same way, b² = cq.
  4. Add the two equations: a² + b² = cp + cq = c(p + q) = c × c.
  5. So a² + b² = c².

Proof 4: President Garfield's Trapezoid

In 1876, while serving in Congress, future U.S. President James A. Garfield published a proof that uses a trapezoid made of three triangles.

  1. Place two copies of the right triangle so their legs line up, and connect the tops. This forms a trapezoid with parallel sides a and b and height a + b.
  2. Area of the trapezoid: ½ × (a + b) × (a + b) = ½(a² + 2ab + b²).
  3. The trapezoid is made of the two original triangles plus a third triangle with two sides of length c and a right angle between them.
  4. Area of the pieces: 2 × (½ab) + ½c² = ab + ½c².
  5. Set them equal: ½a² + ab + ½b² = ab + ½c².
  6. Subtract ab and multiply by 2: a² + b² = c².

The Converse: How To Test For A Right Angle

The converse of the Pythagorean theorem says that if a² + b² = c² for the three sides of a triangle, then the triangle has a right angle. This gives you a test you can run with only a ruler.

Let c be the longest side, then compare a² + b² with c²:

ResultType of triangleExample
a² + b² = c²Right8, 15, 17: 64 + 225 = 289 = 17²
a² + b² > c²Acute (all angles less than 90°)8, 15, 16: 289 > 256
a² + b² < c²Obtuse (one angle more than 90°)4, 5, 7: 41 < 49

Pythagorean Triples

A Pythagorean triple is a set of three whole numbers that fit a² + b² = c². These are worth memorizing, because they appear on tests constantly.

TripleCheck
3, 4, 59 + 16 = 25
5, 12, 1325 + 144 = 169
8, 15, 1764 + 225 = 289
7, 24, 2549 + 576 = 625
20, 21, 29400 + 441 = 841
9, 40, 4181 + 1,600 = 1,681

Multiples also work. Doubling 3, 4, 5 gives 6, 8, 10, and multiplying by 10 gives 30, 40, 50. If you spot that two sides are a multiple of a known triple, you can find the third side without any square roots.

Make your own: for whole numbers m > n, the sides m² − n², 2mn and m² + n² always form a triple. With m = 3 and n = 2, you get 5, 12, 13.

How The Pythagorean Theorem Is Used In Real Life

Any time you need a straight-line distance across a right angle, the Pythagorean theorem gives it. Here are the most common uses.

A Short History Of The Pythagorean Theorem

The theorem is named after Pythagoras, a Greek thinker who lived around 570 to 495 BCE, but people used it long before him. A Babylonian clay tablet called Plimpton 322, from around 1800 BCE, lists numbers that match Pythagorean triples. India's Sulba Sutras and China's Zhoubi Suanjing also describe the rule. New proofs still appear today: in 2023, two New Orleans high school students, Calcea Johnson and Ne'Kiya Jackson, presented proofs based on trigonometry.

When The Pythagorean Theorem Does Not Apply

The theorem only works for right triangles drawn on a flat surface. For any other triangle, use the law of cosines instead:

c² = a² + b² − 2ab cos C

Here, C is the angle across from side c. When C = 90°, cos C = 0, and the law of cosines becomes a² + b² = c². So the Pythagorean theorem is really a special case of this more general rule.

It also only holds exactly on flat surfaces, not on a curved surface like the Earth over long distances.

Common Pythagorean Theorem Mistakes

MistakeExampleFix
Using the wrong side as cTreating a leg as the hypotenusec is always the longest side, across from the right angle
Adding to find a leg13² + 5² for a missing legSubtract: 13² − 5² = 144
Forgetting the square rootStopping at c² = 100Take √100 = 10
Adding the sides before squaring(3 + 4)² = 49Square first: 3² + 4² = 25

Summary

Next step: try the worked examples above on your own, then check your answers with the Pythagorean theorem calculator. For more math help, browse the tools on the Calc Solver homepage.

Frequently Asked Questions

Who discovered the Pythagorean theorem?

No single person discovered it. Babylonian, Indian and Chinese mathematicians used the relationship centuries before Pythagoras. The theorem carries his name because the ancient Greeks credited Pythagoras or his followers with proving it as a general rule for every right triangle. Since no writings by Pythagoras himself survive, historians cannot say for certain what he personally proved.

Does the Pythagorean theorem work for all triangles?

No. It only works for right triangles, which have one 90° angle. For other triangles, a² + b² will be larger or smaller than c². To find a missing side in any triangle, use the law of cosines, which adds a correction term based on the angle. When that angle is 90°, the law of cosines turns back into the Pythagorean theorem.

Can the hypotenuse be shorter than a leg?

No. The hypotenuse is always the longest side of a right triangle, because it sits across from the largest angle, the 90° angle. If your calculation gives a hypotenuse shorter than one of the legs, you probably subtracted instead of added, or mixed up which side is which. Check that c is across from the right angle.

How did Einstein prove the Pythagorean theorem?

According to his own later recollection, Albert Einstein came up with a proof as a boy using similar triangles. He drew the height from the right angle, splitting the triangle into two smaller ones with the same shape as the original. Comparing their areas leads to a² + b² = c². His approach is closely related to the similar triangles proof explained in this guide.

Is the Pythagorean theorem used in trigonometry?

Yes. It is the source of the most important trig identity, sin²θ + cos²θ = 1. On a circle with radius 1, any point forms a right triangle with legs cos θ and sin θ and a hypotenuse of 1. Applying a² + b² = c² to that triangle gives the identity directly. Many other trig formulas build on it.

Try it with your own numbers

Use a free CalcSolver tool to check the examples in this guide.

Open the Pythagorean calculator