Skip to main content

Pythagorean Theorem

Pythagorean Triples: Complete List, Formula & Examples

A Pythagorean triple is three positive integers with a² + b² = c². Get all 16 primitive triples up to hypotenuse 100, Euclid's formula and worked examples.

Three right triangles with whole-number sides: 3-4-5, 5-12-13 and 8-15-17, each labelled with its acute angles.

A Pythagorean triple is a set of three positive integers a, b and c that satisfy a² + b² = c². The two smaller numbers are the legs of a right triangle and the largest is the hypotenuse, so 3-4-5 is a triple because 9 + 16 = 25. There are infinitely many triples, so no page can list them all. What this page does list in full is every primitive triple whose hypotenuse is 100 or less, and there are exactly 16 of them.

a² + b² = c²a, b, c are positive integersc is the largest of the three

The defining condition for a Pythagorean triple.

What counts as a Pythagorean triple

Three conditions have to hold at once:

  1. All three numbers are positive integers. No fractions, no decimals, no zero.
  2. The sum of the squares of the two smaller numbers equals the square of the largest.
  3. The largest number is the hypotenuse. It is never one of the legs.

Condition 3 follows from condition 2 rather than being an extra rule, but writing it out separately prevents a very common slip. If a² + b² = c², then c² is bigger than both a² and b², so c is bigger than both a and b.

Problem 1 Confirming 8-15-17 is a triple

Given
The three integers 8, 15 and 17
Find
Whether a² + b² = c²
Formula
a² + b² = c²
Substitution
8² + 15² = 17²
Calculation
64 + 225 = 289 and 17² = 289

Answer Yes, 8-15-17 is a Pythagorean triple

Because the sides are whole numbers, the angles are not. The 8-15-17 triangle has acute angles of about 28.07° and 61.93°, which sum to 90° as they must. That is the trade-off with every triple: clean sides, untidy angles.

Figure 1

8 15 17 28.07° 61.93°
The 8-15-17 triangle drawn to scale. Whole-number sides, non-whole angles.

Why “complete list” needs a qualifier

The set of Pythagorean triples is infinite. Take any triple and multiply all three numbers by 2, 3, 4 or any positive integer, and the result is another triple. From 3-4-5 alone you get 6-8-10, 9-12-15, 12-16-20, 15-20-25 and so on without end. On top of that, the primitive triples themselves never run out either.

So a genuinely complete list is impossible. The table further down is a complete list of primitive Pythagorean triples with hypotenuse 100 or less, which is a finite and verifiable set of 16 entries. Every other triple with a hypotenuse in that range is an integer multiple of one of those 16, so the table plus multiplication covers everything up to 100.

Primitive vs non-primitive triples

A triple is primitive when the greatest common divisor of all three numbers is 1, written gcd(a, b, c) = 1. It is non-primitive (also called derived or scaled) when the three numbers share a common factor greater than 1.

  • 5-12-13 is primitive. gcd(5, 12, 13) = 1, so it cannot be reduced.
  • 10-24-26 is non-primitive. gcd(10, 24, 26) = 2, and dividing through gives 5-12-13.
  • 15-36-39 is non-primitive. gcd(15, 36, 39) = 3, and dividing through also gives 5-12-13.

Every non-primitive triple reduces to exactly one primitive triple, which is called its base. That base determines the shape of the triangle. All three triangles above have the same pair of acute angles, 22.62° and 67.38°, because they are similar triangles at different scales.

Figure 2

5 12 13 22.62° 67.38°
The 5-12-13 triangle. Its multiples 10-24-26 and 15-36-39 have the same two acute angles.

A quick way to check primitivity: it is enough to test whether the two legs share a factor. If gcd(a, b) = 1 then the triple is automatically primitive, because any factor shared by both legs would also divide c² and therefore c.

How to test whether three numbers form a triple

The test takes one line:

  1. Identify the largest of the three numbers. That is your candidate hypotenuse c.
  2. Square the two smaller numbers and add them.
  3. Square the largest number.
  4. If the two results match exactly, you have a triple. If not, you do not.

Do not accept “close enough”. The test is an equality between integers, so it either holds or it fails.

Problem 2 A set that fails the test

Given
The three integers 6, 7 and 8
Find
Whether 6, 7, 8 is a Pythagorean triple
Formula
a² + b² compared with c²
Substitution
6² + 7² compared with 8²
Calculation
36 + 49 = 85, while 8² = 64. 85 ≠ 64

Answer No. 6-7-8 is not a Pythagorean triple

The failure in Problem 2 is worth reading closely. A triangle with legs 6 and 7 does exist, and it does have a right angle, but its hypotenuse is √85 ≈ 9.2195, not 8. The numbers 6, 7, 8 simply do not describe that triangle. The same thing happens with 4-5-6 (41 against 36), 5-6-7 (61 against 49) and 9-10-11 (181 against 121). Consecutive integers almost never work.

A near miss that catches people out is 8-10-13: 64 + 100 = 164, while 13² = 169. Five apart out of 169, and still not a triple. The true hypotenuse is √164 ≈ 12.8062.

Complete list of primitive Pythagorean triples with hypotenuse ≤ 100

These 16 rows are every primitive triple whose hypotenuse does not exceed 100. Legs are listed smaller first. The angle columns are rounded to two decimal places, and in every row the two angles sum to 90°.

Leg aLeg bHypotenuse cAngle opposite aAngle opposite b
34536.87°53.13°
5121322.62°67.38°
8151728.07°61.93°
7242516.26°73.74°
20212943.60°46.40°
12353718.92°71.08°
9404112.68°77.32°
28455331.89°58.11°
11606110.39°79.61°
16636514.25°75.75°
33566530.51°59.49°
48557341.11°48.89°
1384858.80°81.20°
36778525.06°64.94°
39808925.99°64.01°
65729742.08°47.92°

Three features of this list are worth noticing.

The hypotenuse is always odd. In a primitive triple one leg is odd, the other is even, and the hypotenuse is odd. Any triple with two odd legs, or with an even hypotenuse, is non-primitive.

Hypotenuses can repeat. The value 65 appears twice, as 16-63-65 and 33-56-65, and 85 appears twice, as 13-84-85 and 36-77-85. Two genuinely different right triangles can share a hypotenuse. If a question gives you only the hypotenuse, the triangle is not pinned down.

20-21-29 is the closest to isosceles. Its angles are 43.60° and 46.40°, within about 3.2° of 45-45-90. No primitive triple is ever exactly 45-45-90, because that would need c = a√2 with √2 irrational.

Common non-primitive triples

Every row here is a primitive from the table above multiplied through by a whole number. The angles are unchanged from the base triple, because scaling produces a similar triangle.

Non-primitive triplegcdBase primitiveScale factorAcute angles
6-8-1023-4-5à - 236.87°, 53.13°
9-12-1533-4-5à - 336.87°, 53.13°
12-16-2043-4-5à - 436.87°, 53.13°
15-20-2553-4-5à - 536.87°, 53.13°
30-40-50103-4-5à - 1036.87°, 53.13°
10-24-2625-12-13à - 222.62°, 67.38°
15-36-3935-12-13à - 322.62°, 67.38°
20-48-5245-12-13à - 422.62°, 67.38°
16-30-3428-15-17à - 228.07°, 61.93°
24-45-5138-15-17à - 328.07°, 61.93°
14-48-5027-24-25à - 216.26°, 73.74°
40-42-58220-21-29à - 243.60°, 46.40°

Each row was checked by squaring: 6² + 8² = 36 + 64 = 100 = 10², 10² + 24² = 100 + 576 = 676 = 26², 16² + 30² = 256 + 900 = 1156 = 34², and so on.

Euclid’s formula: generating every primitive triple

Pick two integers m and n with m greater than n greater than 0. Then:

a = m² − n²b = 2mnc = m² + n²

Euclid's formula. Every choice of m greater than n greater than 0 produces a Pythagorean triple.

The formula always works, which you can see by expanding:

  • (m² − n²)² + (2mn)² = m⁴ − 2m²n² + n⁴ + 4m²n² = m⁴ + 2m²n² + n⁴
  • (m² + n²)² = m⁴ + 2m²n² + n⁴

The two expressions are identical, so a² + b² = c² for every m and n.

Derivation table

mna = m² − n²b = 2mnc = m² + n²Triple (sorted)Primitive?
213453-4-5Yes
32512135-12-13Yes
41158178-15-17Yes
43724257-24-25Yes
5221202920-21-29Yes
54940419-40-41Yes
6135123712-35-37Yes
6511606111-60-61Yes
7433566533-56-65Yes
3186106-8-10No (gcd 2)
5124102610-24-26No (gcd 2)
5316303416-30-34No (gcd 2)
4212162012-16-20No (gcd 4)

Notice that the formula orders the legs by its own rule, not by size. With m = 4 and n = 1 it gives a = 15 and b = 8, which is the 8-15-17 triple written the other way round. Leg order carries no meaning, so sorting them smaller first is always allowed.

When the output is primitive

Euclid’s formula gives a primitive triple exactly when both of these hold:

  1. m and n are coprime, meaning gcd(m, n) = 1.
  2. m and n have opposite parity, meaning one is odd and the other is even.

Check this against the failed rows in the table. For m = 3, n = 1 both numbers are odd, so parity fails and the output 6-8-10 carries a factor of 2. For m = 4, n = 2 both are even, so both conditions fail at once and the output 12-16-20 carries a factor of 4. For m = 5, n = 3 the numbers are coprime but both odd, so parity alone sinks it and 16-30-34 has gcd 2.

With those two conditions satisfied, every primitive triple appears exactly once as m and n range over all valid pairs. That is why the list of 16 is provably complete: running m up to 10 covers every hypotenuse m² + n² that can possibly stay at or below 100.

Worked examples with Euclid’s formula

Problem 3 Generate a triple from m = 2, n = 1

Given
m = 2, n = 1
Find
The Pythagorean triple and whether it is primitive
Formula
a = m² − n², b = 2mn, c = m² + n²
Substitution
a = 2² − 1², b = 2(2)(1), c = 2² + 1²
Calculation
a = 4 − 1 = 3, b = 4, c = 4 + 1 = 5. Check: 9 + 16 = 25. gcd(2, 1) = 1 and 2 is even while 1 is odd

Answer 3-4-5, primitive

Problem 4 Generate a triple from m = 3, n = 2

Given
m = 3, n = 2
Find
The Pythagorean triple and whether it is primitive
Formula
a = m² − n², b = 2mn, c = m² + n²
Substitution
a = 3² − 2², b = 2(3)(2), c = 3² + 2²
Calculation
a = 9 − 4 = 5, b = 12, c = 9 + 4 = 13. Check: 25 + 144 = 169 = 13². gcd(3, 2) = 1, opposite parity

Answer 5-12-13, primitive

Problem 5 Generate a triple from m = 5, n = 2

Given
m = 5, n = 2
Find
The Pythagorean triple and whether it is primitive
Formula
a = m² − n², b = 2mn, c = m² + n²
Substitution
a = 5² − 2², b = 2(5)(2), c = 5² + 2²
Calculation
a = 25 − 4 = 21, b = 20, c = 25 + 4 = 29. Check: 441 + 400 = 841 = 29². gcd(5, 2) = 1, opposite parity

Answer 20-21-29, primitive

Problem 6 A pair that produces a non-primitive triple

Given
m = 5, n = 3
Find
The triple, and why it is not primitive
Formula
a = m² − n², b = 2mn, c = m² + n²
Substitution
a = 25 − 9, b = 2(5)(3), c = 25 + 9
Calculation
a = 16, b = 30, c = 34. Check: 256 + 900 = 1156 = 34². But 5 and 3 are both odd, so parity fails and gcd(16, 30, 34) = 2

Answer 16-30-34, non-primitive, reducing to 8-15-17

Figure 3

20 21 29 43.60° 46.40°
The 20-21-29 triple from m = 5, n = 2. The nearest any primitive triple gets to an isosceles right triangle.

The 3-4-5 triple in brief

3-4-5 is the smallest Pythagorean triple: 9 + 16 = 25. Its acute angles are 36.87° and 53.13°. Builders use it to square a corner by measuring 3 units along one edge, 4 along the other, and adjusting until the diagonal reads exactly 5. Scaled versions such as 6-8-10, 9-12-15 and 30-40-50 give longer measuring runs and therefore more accurate corners.

Figure 4

3 4 5 36.87° 53.13°
The 3-4-5 triangle, the smallest Pythagorean triple.

The full treatment of the layout technique, the multiples worth using on site, and the tolerance you should aim for is in the guide to the 3-4-5 rule for squaring corners.

The 5-12-13 triple in brief

5-12-13 is the second-smallest primitive triple: 25 + 144 = 169. Its acute angles are 22.62° and 67.38°, so it is a noticeably thinner triangle than 3-4-5. It shows up constantly in exam questions because 169 is an easy square to recognise, and its multiples 10-24-26, 15-36-39 and 20-48-52 are recognisable for the same reason.

For the trig ratios, the exact angle values and worked problems built on this shape, see the dedicated page on the 5-12-13 right triangle.

Why Pythagorean triples matter

Exact answers without radicals. Most right triangles have an irrational hypotenuse. Legs of 6 and 7 give √85, which you can only write approximately. A triple gives a whole number, so the answer is exact and stays exact through any later step.

Layout and construction. Squaring a corner, checking that a foundation is rectangular, setting out a staircase stringer, verifying that a frame has not racked: all of these come down to measuring a diagonal and comparing it with a number you already know. Triples make that number an integer you can read straight off a tape.

Exam shortcuts. Recognising a triple removes a whole calculation. Given legs of 9 and 40, you can write 41 immediately instead of squaring, adding and taking a root. Recognising a scaled triple does the same: legs of 32 and 60 are 4 Ã - (8-15-17), so the hypotenuse is 4 Ã - 17 = 68.

A ready supply of clean problems. Triples are why so many textbook right triangles have tidy sides. Once you know the list, you can often predict the intended answer before working it through, which is a useful self-check on word problems built on the Pythagorean theorem.

More worked examples

Problem 7 Recognise a scaled triple

Given
A right triangle with legs 32 and 60
Find
The hypotenuse
Formula
Scale the base triple: 32 = 4 Ã - 8 and 60 = 4 Ã - 15
Substitution
Base triple 8-15-17, scale factor 4, so c = 4 Ã - 17
Calculation
c = 68. Check: 32² + 60² = 1024 + 3600 = 4624 and 68² = 4624

Answer 68

Problem 8 Find a missing leg inside a triple

Given
Hypotenuse 68, one leg 32
Find
The other leg
Formula
b = √(c² − a²)
Substitution
b = √(68² − 32²)
Calculation
b = √(4624 − 1024) = √3600 = 60

Answer 60

Problem 9 Diagonal of a rectangle

Given
A rectangle measuring 33 cm by 56 cm
Find
The length of its diagonal
Formula
d = √(a² + b²)
Substitution
d = √(33² + 56²)
Calculation
d = √(1089 + 3136) = √4225 = 65

Answer 65 cm exactly, since 33-56-65 is a primitive triple

Problem 10 Squaring a foundation

Given
A foundation corner marked 30 ft along one side and 40 ft along the other
Find
The diagonal that makes the corner exactly 90°
Formula
c = √(a² + b²), using the 3-4-5 triple scaled by 10
Substitution
c = √(30² + 40²)
Calculation
c = √(900 + 1600) = √2500 = 50

Answer 50 ft

Problem 11 Perimeter and area of a triple triangle

Given
The 20-21-29 right triangle
Find
Perimeter and area
Formula
P = a + b + c, A = ½ab
Substitution
P = 20 + 21 + 29, A = ½ à - 20 à - 21
Calculation
P = 70, A = 210

Answer Perimeter 70 units, area 210 square units

Problem 12 Is 12-16-21 a triple?

Given
The three integers 12, 16 and 21
Find
Whether they satisfy a² + b² = c²
Formula
a² + b² compared with c²
Substitution
12² + 16² compared with 21²
Calculation
144 + 256 = 400, while 21² = 441. 400 ≠ 441

Answer No. The correct hypotenuse for legs 12 and 16 is √400 = 20, giving the triple 12-16-20

Any of these can be re-entered into the right triangle calculator to confirm the sides and read off the angles in one step.

Common mistakes

Assuming consecutive integers work. 3-4-5 is consecutive, which misleads people into trying 4-5-6, 5-6-7, 6-7-8 and 7-8-9. None of them work. 4² + 5² = 41 but 6² = 36. 7² + 8² = 113 but 9² = 81. 3-4-5 is the only Pythagorean triple made of consecutive integers, and its success is a coincidence rather than a pattern.

Putting the largest number in the wrong place. Given 15, 8 and 17, the hypotenuse is 17. Writing 15² + 17² = 8² produces 514 = 64 and fails, then the triple gets rejected as invalid when it was simply written down in the wrong slots. Always identify the largest value first and square that on its own side of the equation.

Calling a scaled triple primitive. 6-8-10 satisfies a² + b² = c², so it is a genuine Pythagorean triple, but gcd(6, 8, 10) = 2 makes it non-primitive. The same applies to 9-12-15, 10-24-26 and 15-36-39. Before calling anything primitive, take the gcd of all three numbers and confirm it is 1.

Expecting whole-number angles. Whole sides do not produce whole angles. The 3-4-5 triangle has angles of 36.87° and 53.13°, not 37° and 53°. Quote the rounded value and say what precision you used.

Forgetting to check parity in Euclid’s formula. Coprime m and n is not enough on its own. m = 5, n = 3 are coprime but both odd, and the result 16-30-34 has a common factor of 2. Both conditions have to hold.

Practice questions

  1. Is 9-40-41 a Pythagorean triple? If so, is it primitive?
  2. Scale 8-15-17 by a factor of 4. Write the resulting triple and state its gcd.
  3. Use Euclid’s formula with m = 6 and n = 1. What triple do you get, and is it primitive?
  4. A right triangle has legs 20 and 21. Find the hypotenuse without a calculator.
  5. Is 10-20-30 a Pythagorean triple? Justify your answer with the squares.
  6. Using Euclid’s formula with m = 9 and n = 4, generate a triple and check both primitivity conditions.

Answer key

  1. Yes, and it is primitive. 9² + 40² = 81 + 1600 = 1681, and 41² = 1681. gcd(9, 40, 41) = 1.
  2. 32-60-68, gcd 4. 32² + 60² = 1024 + 3600 = 4624 = 68². Dividing by 4 returns 8-15-17.
  3. 12-35-37, primitive. a = 36 − 1 = 35, b = 2(6)(1) = 12, c = 36 + 1 = 37. Check: 144 + 1225 = 1369 = 37². gcd(6, 1) = 1 and 6 is even while 1 is odd.
  4. 29. 20-21-29 is on the primitive list. Confirming: 400 + 441 = 841 = 29².
  5. No. 10² + 20² = 100 + 400 = 500, while 30² = 900. The real hypotenuse for legs 10 and 20 is √500 ≈ 22.3607, which is irrational.
  6. 65-72-97, primitive. a = 81 − 16 = 65, b = 2(9)(4) = 72, c = 81 + 16 = 97. Check: 4225 + 5184 = 9409 = 97². gcd(9, 4) = 1, and 9 is odd while 4 is even, so both conditions hold. This is the largest primitive with hypotenuse at or below 100.

If a practice answer does not match, solve the triangle from its sides and compare the hypotenuse and both angles against your working.

Frequently Asked Questions

How many Pythagorean triples are there?

Infinitely many. Every triple can be scaled by any positive integer to make another one, and the primitive triples themselves are also infinite in number. Only the count within a stated bound is finite: there are exactly 16 primitive triples with hypotenuse 100 or less.

What is the difference between a primitive and a non-primitive triple?

A primitive triple has gcd(a, b, c) = 1, so the three numbers share no common factor above 1. A non-primitive triple is an integer multiple of some primitive, such as 6-8-10, which is 3-4-5 doubled. Both are valid triples and both describe real right triangles; only the primitive one cannot be reduced.

Is 3-4-5 the only triple made of consecutive numbers?

Yes. 3-4-5 is the only Pythagorean triple whose three values are consecutive integers. Sets such as 4-5-6, 5-6-7 and 6-7-8 all fail the test, because the gap between c² and a² + b² grows as the numbers get larger.

Can a Pythagorean triple have an even hypotenuse?

Yes, but never a primitive one. Triples such as 6-8-10, 10-24-26 and 16-30-34 all have even hypotenuses, and every one of them is a scaled copy of a primitive triple. In a primitive triple the hypotenuse is always odd, and exactly one leg is even.

Does Euclid’s formula produce every Pythagorean triple?

Yes, with the right setup. Every primitive triple comes from exactly one pair of coprime integers m greater than n greater than 0 of opposite parity, and every non-primitive triple is a primitive one multiplied by an integer k. So the pair (m, n) together with a scale factor k generates the complete set.