---
title: "Pythagoras Theorem Explained, With a Visual Proof"
description: "Pythagoras theorem explained: what a² + b² = c² means, a visual proof, when to add or subtract, the converse, triples, distance and real-life uses."
slug: pythagoras-theorem-explained
canonical: https://learn.modernagecoders.com/blog/pythagoras-theorem-explained/
date: 2026-09-28
dateModified: 2026-09-28
category: "Mathematics"
tags: ["Maths", "Geometry", "Pythagoras", "Students"]
keywords: ["pythagoras theorem", "pythagoras theorem explained", "pythagorean theorem", "pythagoras theorem proof", "pythagorean triples", "how to use pythagoras theorem", "converse of pythagoras theorem", "a2 + b2 = c2"]
readTime: "9 min read"
author: "Modern Age Coders Team"
---
# Pythagoras' Theorem Explained

> What a² + b² = c² really means, a proof you can check with paper triangles, when to add and when to subtract, and where it turns up in real life.

![Pythagoras theorem explained: a 3-4-5 right triangle with squares of area 9, 16 and 25 on its sides](/images/blog/pythagoras-theorem-explained/00-hero.png)

*By Modern Age Coders Team · 2026-09-28 · 9 min read*

**Quick answer:** Pythagoras' theorem says that in a right-angled triangle, the square of the hypotenuse (the longest side, opposite the right angle) equals the sum of the squares of the other two sides: a² + b² = c². To find the hypotenuse, add the squares and take the square root; to find a shorter side, subtract. It only works for right-angled triangles. The converse tests for a right angle, Pythagorean triples like 3, 4, 5 fit it exactly, and the distance formula is the same idea on a grid.

Pythagoras' theorem is probably the most famous result in all of mathematics, and for good reason. It connects the three sides of any right-angled triangle with one short equation, it has been proved in hundreds of different ways, and it quietly powers everything from building work to the graphics in video games. It is also one of the first places in school maths where students meet a real proof, which is why it deserves more than a formula to memorise.

This guide explains what the theorem says, proves it with a picture you can check with scissors, shows how to use it in both directions, and covers the converse, Pythagorean triples, distance and 3D. Every numerical answer here was checked by running it in Python, and the code is included.

## What Pythagoras' theorem says

Take any triangle with a right angle, a 90 degree corner. The side opposite the right angle is called the **hypotenuse**. It is always the longest side. Call it c, and call the other two sides a and b. Then:

**a² + b² = c²**

"a²" means a squared, a times a, and it really is the area of a square with sides of length a. So the theorem is a statement about areas: if you draw a square on each side of a right-angled triangle, the two smaller squares together have exactly the same area as the big one. For the famous 3, 4, 5 triangle, that is 9 + 16 = 25.

## A proof you can check with scissors

Plenty of students can quote a² + b² = c² without ever being shown why it is true. Here is one of the oldest and clearest proofs, and it needs no algebra at all.

![Rearrangement proof of Pythagoras' theorem: the same big square with four identical triangles arranged two ways, leaving either c squared or a squared plus b squared](/images/blog/pythagoras-theorem-explained/01-proof.png)

*Same square, same four triangles. The uncovered area must be the same in both.*

1. Draw a big square with sides of length a + b.
2. Place four copies of your right-angled triangle inside it, one in each corner, so the uncovered space in the middle is a tilted square with side c. The uncovered area is **c²**.
3. Now rearrange the same four triangles inside an identical big square, pairing them into two rectangles. The uncovered space is now two squares, one with side a and one with side b. The uncovered area is **a² + b²**.
4. The big squares are the same size and the triangles are the same four triangles. So the uncovered areas must be equal: c² = a² + b².

Cut four triangles out of card and try it. It is one of the most satisfying ten minutes in school maths, and a child who has done it will never forget which way round the theorem goes.

> **Who really discovered it?**

> The theorem is named after Pythagoras, a Greek thinker of the 6th century BCE, but the relationship was known long before him. A Babylonian clay tablet known as Plimpton 322, from roughly 1800 BCE, lists numbers closely linked to Pythagorean triples, and the Baudhayana Shulba Sutra, an Indian text on building fire altars dated to somewhere between 800 and 500 BCE, states the rule for the diagonal of a rectangle. Pythagoras' followers are credited with an early proof.

## How to use it: add or subtract?

Almost every Pythagoras question comes down to one decision. Are you finding the longest side, or one of the shorter ones?

![Deciding whether to add or subtract in Pythagoras' theorem: add the squares to find the hypotenuse, subtract to find a shorter side](/images/blog/pythagoras-theorem-explained/02-add-or-subtract.png)

*The hypotenuse is the longest side, so its calculation always adds.*

**pythagoras.py**

```python
from math import sqrt

# 1. find the longest side (the hypotenuse): ADD the squares
a, b = 6, 8
print("hypotenuse of a 6-8 triangle:", sqrt(a**2 + b**2))

# 2. find a shorter side: SUBTRACT the squares
c, a = 13, 5
print("missing side when c = 13 and a = 5:", sqrt(c**2 - a**2))

# 3. a 5 m ladder with its foot 1.4 m from the wall: how high does it reach?
print("ladder reaches:", round(sqrt(5**2 - 1.4**2), 2), "m up the wall")

# 4. a "55 inch" screen is measured on the diagonal; at 16:9, how wide is it?
width = 55 * 16 / sqrt(16**2 + 9**2)
print("width of a 55 inch 16:9 screen:", round(width, 1), "inches")
```

**Output**

```text
hypotenuse of a 6-8 triangle: 10.0
missing side when c = 13 and a = 5: 12.0
ladder reaches: 4.8 m up the wall
width of a 55 inch 16:9 screen: 47.9 inches
```

- **Finding the hypotenuse:** square the two shorter sides, add, take the square root. 6 and 8 give √(36 + 64) = √100 = 10.
- **Finding a shorter side:** square both known sides, subtract the smaller from the larger, take the square root. With 13 and 5, √(169 − 25) = √144 = 12.
- **Word problems:** sketch the triangle first and mark the right angle. The ladder is the hypotenuse, because it is opposite the right angle between the wall and the ground.

> **The two most common mistakes**

> First, using the theorem on a triangle with no right angle. It only works for right-angled triangles. Second, adding when you should subtract. If your answer for a shorter side comes out longer than the hypotenuse, you have added by mistake. A quick sketch prevents both.

## The converse: testing for a right angle

The theorem also works backwards. If the sides of a triangle satisfy a² + b² = c², where c is the longest side, then the triangle must contain a right angle. This is how builders check that a corner is square: measure 3 units along one wall, 4 along the other, and if the diagonal between those points is exactly 5, the corner is 90 degrees.

**right_angle_test.py**

```python
def is_right_angled(x, y, z):
    a, b, c = sorted((x, y, z))           # the longest side must be c
    return a * a + b * b == c * c

for sides in [(3, 4, 5), (5, 12, 13), (6, 7, 9), (20, 21, 29), (7, 8, 11)]:
    print(sides, "right angle" if is_right_angled(*sides) else "not a right angle")
```

**Output**

```text
(3, 4, 5) right angle
(5, 12, 13) right angle
(6, 7, 9) not a right angle
(20, 21, 29) right angle
(7, 8, 11) not a right angle
```

Note that the function sorts the sides first. The longest side has to be c, and forgetting this is a common reason students get the converse wrong.

## Pythagorean triples

A Pythagorean triple is a set of three whole numbers that fit the theorem exactly, like 3, 4, 5. They are worth knowing because exam questions often use them to keep the arithmetic tidy, and spotting one saves time. More than two thousand years ago, Euclid described a formula that generates them: pick two whole numbers m and n, with m bigger, and then m² − n², 2mn and m² + n² always form a triple. Here it is, generating every primitive triple (one that is not just a multiple of a smaller one) with a hypotenuse of 50 or less:

**triples.py**

```python
from math import gcd

# Euclid's formula: for m > n > 0, coprime and not both odd,
# a = m^2 - n^2, b = 2mn, c = m^2 + n^2 is a primitive Pythagorean triple
triples = []
for m in range(2, 8):
    for n in range(1, m):
        if gcd(m, n) == 1 and (m - n) % 2 == 1:
            a, b, c = m*m - n*n, 2*m*n, m*m + n*n
            if c <= 50:
                triples.append(tuple(sorted((a, b)) + [c]))

for a, b, c in sorted(triples, key=lambda t: t[2]):
    assert a*a + b*b == c*c
    print(f"{a:>2}, {b:>2}, {c:>2}    {a*a:>4} + {b*b:>4} = {c*c:>4}")
print(len(triples), "primitive triples with a hypotenuse of 50 or less")
```

**Output**

```text
 3,  4,  5       9 +   16 =   25
 5, 12, 13      25 +  144 =  169
 8, 15, 17      64 +  225 =  289
 7, 24, 25      49 +  576 =  625
20, 21, 29     400 +  441 =  841
12, 35, 37     144 + 1225 = 1369
 9, 40, 41      81 + 1600 = 1681
7 primitive triples with a hypotenuse of 50 or less
```

![The 7 primitive Pythagorean triples with a hypotenuse of 50 or less, generated by Euclid's formula](/images/blog/pythagoras-theorem-explained/03-triples.png)

*3, 4, 5 and 5, 12, 13 appear in exam questions more than any others.*

There are exactly 7 of them. Multiply any of these by a whole number and you get another triple, so 3, 4, 5 also gives 6, 8, 10 and 9, 12, 15. If you see two sides of 9 and 12 in a question, the third side is almost certainly 15.

## Distance and 3D: Pythagoras in disguise

Once you know the theorem, you start seeing it everywhere. The straight-line distance between two points on a grid is the hypotenuse of a right-angled triangle whose other sides are how far across and how far up you go. That is the distance formula taught in coordinate geometry, and it is the same calculation every video game does thousands of times a second to work out how far apart two characters are.

**distance.py**

```python
from math import dist, sqrt

# distance between two points on a map grid is Pythagoras in disguise
home, school = (2, 3), (8, 11)
dx, dy = school[0] - home[0], school[1] - home[1]
print("across", dx, "up", dy, "-> straight line", sqrt(dx**2 + dy**2))
print("math.dist agrees:", dist(home, school))

# in 3D, apply it twice: the longest rod that fits in a 3 x 4 x 12 box
floor_diagonal = sqrt(3**2 + 4**2)
print("space diagonal:", sqrt(floor_diagonal**2 + 12**2))
```

**Output**

```text
across 6 up 8 -> straight line 10.0
math.dist agrees: 10.0
space diagonal: 13.0
```

In three dimensions, apply the theorem twice. First find the diagonal across the floor of a box, then use that as one side of a new right-angled triangle standing up inside the box. The longest rod that fits in a 3 by 4 by 12 box is exactly 13 units, and it is no coincidence that 5, 12, 13 is also a triple.

## Where Pythagoras is used in real life

![Real-life uses of Pythagoras' theorem: ladders, screen sizes, map and game distances, and checking square corners in building](/images/blog/pythagoras-theorem-explained/04-uses.png)

*The same equation, four very different jobs.*

Beyond the classroom, the theorem is used in construction, navigation, surveying, computer graphics, physics and engineering. Screen sizes are a nice everyday example: a TV sold as 55 inches is measured along the diagonal, so its actual width, about 47.9 inches for a 16:9 screen as the first program shows, comes from Pythagoras. For more on how maths turns up in programming, see our guide to [maths in programming](/blog/role-of-mathematics-programming-logical-problem-solving).

> If a student can prove it with four paper triangles, they will never forget which side is c.

## How we teach it

Our teaching principles, set out on the [how we teach](/how-we-teach) page, include deriving a rule before seeing it written down, and Pythagoras is the classic case: a student who has seen why it works rarely forgets it. We teach it in our [live online maths classes](/online-maths-tuition) for syllabuses including [Class 10 maths](/maths-class-10) and [GCSE maths](/gcse-maths-tuition-online), one to one or in small groups of 5 to 10.

[Book a free maths class](/book-demo) [Book a priority demo](/book-demo)

## Frequently asked questions

**What is Pythagoras' theorem in simple words?**

In a right-angled triangle, if you square the two shorter sides and add them, you get the square of the longest side. Written as a formula, a² + b² = c², where c is the hypotenuse, the side opposite the right angle.

**Does Pythagoras' theorem work for all triangles?**

No. It only works for right-angled triangles. For other triangles you need the cosine rule, which is a more general version of the same idea and reduces to Pythagoras when the angle is 90 degrees.

**How do I know which side is the hypotenuse?**

The hypotenuse is the side opposite the right angle, and it is always the longest side of a right-angled triangle. Find the small square marking the right angle, then look at the side that does not touch it.

**How do you find a shorter side using Pythagoras?**

Square the hypotenuse, square the side you know, subtract the smaller from the larger, and take the square root. For a hypotenuse of 13 and a side of 5, the missing side is the square root of 169 minus 25, which is 12.

**What is a Pythagorean triple?**

A set of three whole numbers that satisfy a² + b² = c² exactly, such as 3, 4, 5 or 5, 12, 13. Multiplying a triple by any whole number gives another triple, so 6, 8, 10 is one too.

**What is the converse of Pythagoras' theorem?**

If the sides of a triangle satisfy a² + b² = c², with c as the longest side, then the triangle has a right angle. It is used to check that corners are square, for example with a 3, 4, 5 measurement.

**Who discovered Pythagoras' theorem?**

It is named after the Greek thinker Pythagoras, from the 6th century BCE, but the relationship was known much earlier. Babylonian mathematicians around 1800 BCE and the Indian Baudhayana Shulba Sutra both record it. Pythagoras' school is credited with an early proof.

---

*Source: https://learn.modernagecoders.com/blog/pythagoras-theorem-explained/*
