Trigonometry

Pythagorean Triples Calculator

A Pythagorean triple is three whole numbers a, b and c with a² + b² = c², the side lengths of a right triangle.

Try
What do you want to do?
Show

Result

Pythagorean triples with c ≤ 100: 52 triples

Pythagorean triples with c ≤ 100

52 triples

16 primitive

Primitive triples
16
Multiples of a primitive triple
36
Triple with the largest hypotenuse
(60, 80, 100)

There are 52 Pythagorean triples with a hypotenuse of 100 or less, listed by hypotenuse. Each one satisfies a² + b² = c².

Legs (a, b) of every triple with c ≤ 100, plotted both ways round
02040608010020406080LegOther legPrimitiveMultiple
Pythagorean triples with c ≤ 100, sorted by hypotenuse
#abcPrimitive or multiplePerimeter
1345Primitive12
268102 × (3, 4, 5)24
351213Primitive30
4912153 × (3, 4, 5)36
581517Primitive40
61216204 × (3, 4, 5)48
772425Primitive56
81520255 × (3, 4, 5)60
91024262 × (5, 12, 13)60
10202129Primitive70
111824306 × (3, 4, 5)72
121630342 × (8, 15, 17)80
132128357 × (3, 4, 5)84
14123537Primitive84
151536393 × (5, 12, 13)90
162432408 × (3, 4, 5)96
1794041Primitive90
182736459 × (3, 4, 5)108
191448502 × (7, 24, 25)112
2030405010 × (3, 4, 5)120
212445513 × (8, 15, 17)120
222048524 × (5, 12, 13)120
23284553Primitive126
2433445511 × (3, 4, 5)132
254042582 × (20, 21, 29)140
2636486012 × (3, 4, 5)144
27116061Primitive132
28166365Primitive144
292560655 × (5, 12, 13)150
30335665Primitive154
3139526513 × (3, 4, 5)156
323260684 × (8, 15, 17)160
3342567014 × (3, 4, 5)168
34485573Primitive176
352470742 × (12, 35, 37)168
362172753 × (7, 24, 25)168
3745607515 × (3, 4, 5)180
383072786 × (5, 12, 13)180
3948648016 × (3, 4, 5)192
401880822 × (9, 40, 41)180
41138485Primitive182
42367785Primitive198
434075855 × (8, 15, 17)200
4451688517 × (3, 4, 5)204
456063873 × (20, 21, 29)210
46398089Primitive208
4754729018 × (3, 4, 5)216
483584917 × (5, 12, 13)210
4957769519 × (3, 4, 5)228
50657297Primitive234
5128961004 × (7, 24, 25)224
52608010020 × (3, 4, 5)240

The smallest is 3, 4, 5, since 9 + 16 = 25. Up to 100 there are 52 triples, 16 of them primitive. List every triple up to 1,000, check any three numbers, generate new triples with Euclid’s formula, or find every triple that contains a given side.

By Hira Noor, mathematicianLast reviewed Free, no sign-up, runs in your browserReport a problem

How to use this calculator

  1. Pick what you want to do. List triples shows every triple up to a hypotenuse you choose, 100 by default; switch to Primitive only to drop the multiples.
  2. Check 3 numbers tests whether a, b and c form a triple, in any order, and shows the squares added up. A triple is labelled primitive or as a multiple of its base triple.
  3. Generate (m, n) applies Euclid’s formula: type two whole numbers with m larger than n, and an optional scale factor k.
  4. Find by side lists every triple that has your number as a leg or as the hypotenuse, for example all four triples that contain 12.
  5. To solve a right triangle whose sides are not whole numbers, use the Pythagorean theorem calculator.

Formulas

The Pythagorean triple condition

a2+b2=c2,a,b,c∈{1,2,3,…}a^2 + b^2 = c^2, \quad a, b, c \in \{1, 2, 3, \ldots\}

Plain-text formula: a^2 + b^2 = c^2, a, b, c ∈ {1, 2, 3, …}

a,ba, b
the legs, the two sides that meet at the right angle
cc
the hypotenuse, the longest side, opposite the right angle

Three positive whole numbers form a Pythagorean triple when the squares of the two smaller ones add up to the square of the largest. By the converse of the Pythagorean theorem, they are then the sides of a right triangle, with c as the hypotenuse.

Euclid’s formula

a=m2−n2,b=2mn,c=m2+n2a = m^2 - n^2, \quad b = 2mn, \quad c = m^2 + n^2

Plain-text formula: a = m^2 − n^2, b = 2mn, c = m^2 + n^2

m,nm, n
whole numbers with m larger than n

Any two whole numbers m > n ≥ 1 give a triple. It is primitive exactly when m and n have no common factor and one of them is even. Every primitive triple comes from exactly one such pair, so the formula lists them all.

Multiples of a triple

(ka)2+(kb)2=k2(a2+b2)=(kc)2(ka)^2 + (kb)^2 = k^2(a^2 + b^2) = (kc)^2

Plain-text formula: (ka)^2 + (kb)^2 = k^2(a^2 + b^2) = (kc)^2

kk
the scale factor, any positive whole number

Multiplying all three sides by the same whole number k gives another triple, so (3, 4, 5) gives (6, 8, 10), (9, 12, 15) and so on. Dividing a triple by the greatest common divisor of its sides gives back its primitive base triple.

Reading the result

In List mode, the count above the table is the number of triples with a hypotenuse up to your limit. Each row says whether the triple is primitive, meaning its sides share no common factor, or a multiple of a smaller triple, such as 3 × (3, 4, 5) for (9, 12, 15). Up to 100 there are 52 triples, and 16 of them are primitive.

In Check mode, a “yes” means the numbers are the sides of a right triangle with whole-number sides. A “no” tells you whether the triangle would be acute or obtuse instead, and suggests a nearby triple when one of the sides can be swapped for a whole number that works.

What is a Pythagorean triple?

A Pythagorean triple is a set of three positive whole numbers (a, b, c) that satisfy a2+b2=c2a^2 + b^2 = c^2. Because they fit the Pythagorean theorem, they are the side lengths of a right triangle: a and b are the legs, and c is the hypotenuse. They are also called Pythagorean triplets or Pythagorean numbers.

The best known is (3, 4, 5): 32+42=9+16=25=523^2 + 4^2 = 9 + 16 = 25 = 5^2. Most sets of three numbers fail the test. For (4, 5, 6), 16+25=4116 + 25 = 41, and 41 is not 3636. In fact, the legs of most right triangles do not produce a whole-number hypotenuse: legs 1 and 1 give 2\sqrt{2}, and legs 2 and 3 give 13\sqrt{13}.

Five triples are worth memorising because they come up again and again in right-triangle problems: (3, 4, 5), (5, 12, 13), (8, 15, 17), (7, 24, 25) and (20, 21, 29). Spot one of them, or a multiple such as (6, 8, 10), and you know the third side without a calculator.

In a triple (a, b, c), a and b are the legs that meet at the right angle and c is the hypotenuse.

Pythagorean triples list from 1 to 100

There are 16 primitive Pythagorean triples with a hypotenuse of 100 or less. Every other triple up to 100 is a multiple of one of them, which brings the total to 52. The last column gives the m and n that produce each one through Euclid’s formula. Choose List triples above to see all 52, or raise the limit to 1,000 for 881 triples, 158 of them primitive.

All 16 primitive Pythagorean triples with c ≤ 100
Triple (a, b, c)Check a² + b² = c²Euclid m and n
3, 4, 59 + 16 = 25m = 2, n = 1
5, 12, 1325 + 144 = 169m = 3, n = 2
8, 15, 1764 + 225 = 289m = 4, n = 1
7, 24, 2549 + 576 = 625m = 4, n = 3
20, 21, 29400 + 441 = 841m = 5, n = 2
12, 35, 37144 + 1225 = 1369m = 6, n = 1
9, 40, 4181 + 1600 = 1681m = 5, n = 4
28, 45, 53784 + 2025 = 2809m = 7, n = 2
11, 60, 61121 + 3600 = 3721m = 6, n = 5
16, 63, 65256 + 3969 = 4225m = 8, n = 1
33, 56, 651089 + 3136 = 4225m = 7, n = 4
48, 55, 732304 + 3025 = 5329m = 8, n = 3
13, 84, 85169 + 7056 = 7225m = 7, n = 6
36, 77, 851296 + 5929 = 7225m = 9, n = 2
39, 80, 891521 + 6400 = 7921m = 8, n = 5
65, 72, 974225 + 5184 = 9409m = 9, n = 4

The first 10 and first 20 Pythagorean triples

Ordered by hypotenuse, the first 10 Pythagorean triples are (3, 4, 5), (6, 8, 10), (5, 12, 13), (9, 12, 15), (8, 15, 17), (12, 16, 20), (7, 24, 25), (15, 20, 25), (10, 24, 26) and (20, 21, 29). The table continues to 20. Two triples can share a hypotenuse: 25 is the hypotenuse of both (7, 24, 25) and (15, 20, 25).

The first 20 Pythagorean triples, ordered by hypotenuse
#Triple (a, b, c)Primitive or multiple
13, 4, 5Primitive
26, 8, 102 × (3, 4, 5)
35, 12, 13Primitive
49, 12, 153 × (3, 4, 5)
58, 15, 17Primitive
612, 16, 204 × (3, 4, 5)
77, 24, 25Primitive
815, 20, 255 × (3, 4, 5)
910, 24, 262 × (5, 12, 13)
1020, 21, 29Primitive
1118, 24, 306 × (3, 4, 5)
1216, 30, 342 × (8, 15, 17)
1321, 28, 357 × (3, 4, 5)
1412, 35, 37Primitive
1515, 36, 393 × (5, 12, 13)
1624, 32, 408 × (3, 4, 5)
179, 40, 41Primitive
1827, 36, 459 × (3, 4, 5)
1914, 48, 502 × (7, 24, 25)
2030, 40, 5010 × (3, 4, 5)

Primitive triples and their multiples

A triple is primitive when a, b and c have no common factor other than 1. (3, 4, 5), (5, 12, 13) and (8, 15, 17) are primitive. Multiply a primitive triple by any whole number and you get another triple: (3, 4, 5) gives (6, 8, 10), (9, 12, 15), (12, 16, 20) and so on without end.

To find the base triple, divide all three sides by their greatest common divisor. For (10, 24, 26), the GCD is 2, so it is 2 × (5, 12, 13). The GCD calculator shows that division step by step.

In every primitive triple, exactly one leg is even and the hypotenuse is odd. One leg is always a multiple of 3, one leg is a multiple of 4, and one of the three sides is a multiple of 5, which is why the area 12ab\tfrac{1}{2}ab of a triple’s triangle is always a multiple of 6.

How to generate Pythagorean triples with Euclid’s formula

Pick two whole numbers m and n with m larger than n. Then a=m2−n2a = m^2 - n^2, b=2mnb = 2mn and c=m2+n2c = m^2 + n^2 always form a triple, because (m2−n2)2+(2mn)2=(m2+n2)2(m^2 - n^2)^2 + (2mn)^2 = (m^2 + n^2)^2. For m = 2 and n = 1 you get (3, 4, 5); for m = 3 and n = 2 you get (5, 12, 13).

The result is primitive when m and n share no common factor and are not both odd. If both are odd, every side is even, so the triple is twice a smaller one: m = 3 and n = 1 give (8, 6, 10) = 2 × (4, 3, 5). Multiply by a scale factor k to reach every non-primitive triple too.

Triples from Euclid’s formula for small m and n
mna = m² − n²b = 2mnc = m² + n²
21345
3251213
4115817
4372425
52212029
5494041
61351237
65116061

Quick ways to find a triple from one number

From any odd number n of 3 or more: the triple is (n,n2−12,n2+12)\left(n, \tfrac{n^2 - 1}{2}, \tfrac{n^2 + 1}{2}\right). For n = 7: (7, 24, 25). For n = 9: (9, 40, 41). The other leg and the hypotenuse always differ by 1.

From any even number 2n of 4 or more: the triple is (2n,n2−1,n2+1)(2n, n^2 - 1, n^2 + 1). For 2n = 8, n = 4 and the triple is (8, 15, 17). For 2n = 12: (12, 35, 37).

These give one triple each, but a number can belong to many. 12 is a side of four triples: (5, 12, 13), (9, 12, 15), (12, 16, 20) and (12, 35, 37). Find by side above lists all of them, including triples where your number is the hypotenuse. A number can be a hypotenuse only if it has a prime factor of the form 4k + 1, such as 5, 13, 17 or 29.

Where Pythagorean triples come from

Triples were known long before Pythagoras. A Babylonian clay tablet called Plimpton 322, from around 1800 BCE, lists rows of numbers that match the sides of right triangles, including the triple (119, 120, 169). Euclid’s Elements, written around 300 BCE, gives the general formula used on this page.

Builders still use the 3-4-5 triple to set out square corners: mark 3 units along one wall and 4 along the other, and the diagonal between the marks is exactly 5 when the corner is 90°. Scaled up, 6-8-10 or 9-12-15 feet does the same on a deck or slab.

Pythagorean triple days are dates that form a triple in month/day/year order: 3/4/05, 5/12/13, 8/15/17, 12/16/20, 7/24/25 and 10/24/26. October 24, 2026 was the last one this century; the next is March 4, 2105.

Common mistakes

Putting the largest number in the wrong place. The hypotenuse c must be the largest of the three. (5, 3, 4) is still a triple, but 52+32=425^2 + 3^2 = 4^2 is false. The checker sorts the numbers for you.

Adding before squaring. 3+4=73 + 4 = 7, and 72=497^2 = 49, not 25. Square each leg first, then add.

Thinking every multiple is a new primitive triple. (9, 12, 15) is a triple, but it is 3 × (3, 4, 5), not a primitive one.

Using both odd numbers in Euclid’s formula. m = 5 and n = 3 give (16, 30, 34), which is 2 × (8, 15, 17); it repeats a triple you already had.

Practice problems with answers

Work each one out, then check it by typing the numbers into the calculator above.

Pythagorean triples practice problems and answers
QuestionAnswerWorking
Is (20, 21, 29) a Pythagorean triple?Yes, primitive400 + 441 = 841 = 29²
Is (6, 9, 11) a Pythagorean triple?No36 + 81 = 117, but 11² = 121
Which triple do m = 4 and n = 1 give?(15, 8, 17)16 − 1, 2 × 4 × 1, 16 + 1
The legs are 9 and 40. What is c?4181 + 1,600 = 1,681 = 41²
Find a triple with 11 as a leg.(11, 60, 61)(121 − 1) ÷ 2 = 60, (121 + 1) ÷ 2 = 61
Is (10, 24, 26) primitive?No, 2 × (5, 12, 13)All three sides are even

Worked example

Is 9, 12, 15 a Pythagorean triple?

Check whether 9, 12 and 15 form a Pythagorean triple, and say whether it is primitive.

  1. The largest number, 15, has to be the hypotenuse c. The legs are a = 9 and b = 12.
  2. Square the legs and add them: 9² + 12² = 81 + 144 = 225.
  3. Square the hypotenuse: 15² = 225. The two sides match, so 9, 12, 15 is a Pythagorean triple.
  4. All three numbers are divisible by 3: 9 ÷ 3 = 3, 12 ÷ 3 = 4 and 15 ÷ 3 = 5. So it is not primitive; it is 3 × (3, 4, 5).

Answer: Yes. (9, 12, 15) is a Pythagorean triple, three times the primitive triple (3, 4, 5).

Frequently asked questions

What are the first 10 Pythagorean triples?

Ordered by hypotenuse: (3, 4, 5), (6, 8, 10), (5, 12, 13), (9, 12, 15), (8, 15, 17), (12, 16, 20), (7, 24, 25), (15, 20, 25), (10, 24, 26) and (20, 21, 29). Counting only primitive triples, the first 10 are (3, 4, 5), (5, 12, 13), (8, 15, 17), (7, 24, 25), (20, 21, 29), (12, 35, 37), (9, 40, 41), (28, 45, 53), (11, 60, 61) and (16, 63, 65).

What are the five most common Pythagorean triples?

The five primitive triples used most in class and on tests are (3, 4, 5), (5, 12, 13), (8, 15, 17), (7, 24, 25) and (20, 21, 29). Their multiples, such as (6, 8, 10) and (10, 24, 26), are triples too.

Are 9, 12 and 15 a Pythagorean triple?

Yes. 9² + 12² = 81 + 144 = 225 = 15². It is not primitive, because it is 3 × (3, 4, 5).

What is the formula for Pythagorean triples?

Euclid’s formula: for whole numbers m > n, the numbers m² − n², 2mn and m² + n² form a triple. With m = 2 and n = 1 it gives (3, 4, 5). It gives every primitive triple when m and n are coprime and not both odd.

What is a primitive Pythagorean triple?

A triple whose three numbers have no common factor other than 1, such as (3, 4, 5) or (5, 12, 13). Every other triple is a whole-number multiple of a primitive one.

How many Pythagorean triples are there?

Infinitely many. Every odd number from 3 up is the shortest side of a primitive triple, and every triple has infinitely many multiples. With a hypotenuse up to 100 there are 52 triples, 16 of them primitive; up to 1,000 there are 881, 158 of them primitive.

Can a Pythagorean triple contain decimals?

No. A triple is three whole numbers. Sides such as 1.5, 2 and 2.5 do form a right triangle, and doubling them gives the triple (3, 4, 5), but the decimals themselves are not a triple.

Triangle Calculator

Solve any triangle from SSS, SAS, ASA, AAS or SSA, with law of sines and cosines steps and the ambiguous case.

Trigonometry

LCM and GCF Calculator

LCM and GCF of up to 10 numbers with steps: multiples, prime factors, Euclid’s algorithm and a coprime check.

Number Theory & Bases

Square Root Calculator

Square, cube and nth roots in simplest radical form, with decimals and prime-factor steps.

Arithmetic & Numbers

Sources and further reading

  1. Pythagorean Triangles, Dover Publications (reprint of the 1962 edition) (Wacław Sierpiński, 2003)
  2. Words and Pictures: New Light on Plimpton 322, The American Mathematical Monthly, vol. 109, no. 2, Mathematical Association of America (Eleanor Robson, 2002)
  3. Pythagorean Triple (opens in a new tab), Wolfram MathWorld (Eric W. Weisstein)
  4. Euclid’s Elements, Book X, Proposition 29, Lemma 1 (opens in a new tab), Clark University (D. E. Joyce)

Results are calculated in your browser with methods checked by automated tests, and are intended for learning and general use. For engineering, medical, financial, legal or safety-critical decisions, verify important values independently and follow the rounding rules your work requires. How accurate are these results?