Pythagorean Triples Generator

List every Pythagorean triple up to a limit, build one from Euclid's formula, check any three numbers, or find every triple that contains a given number, with the working shown.

By the PythagoreanTheorem.net teamUpdated Free · no sign-up

11 triples with c ≤ 30

5 of them are primitive (no common factor); the rest are multiples of a primitive triple.

abcType
345Primitive (m = 2, n = 1)
68102 × (3, 4, 5)
51213Primitive (m = 3, n = 2)
912153 × (3, 4, 5)
81517Primitive (m = 4, n = 1)
1216204 × (3, 4, 5)
72425Primitive (m = 4, n = 3)
1520255 × (3, 4, 5)
1024262 × (5, 12, 13)
202129Primitive (m = 5, n = 2)
1824306 × (3, 4, 5)

A Pythagorean triple is three whole numbers a, b and c with a2 + b2 = c2, such as (3, 4, 5): the sides of a right triangle with no decimals or roots. This Pythagorean triples generator lists them up to any limit, builds them with Euclid's formula, checks any three numbers and finds every triple containing a given number.

How to use the four modes

List triples
Enter a largest hypotenuse (up to 2,000) to see every triple with c at most that number, sorted by c. The Type column says whether each one is primitive and which m and n produce it, or which primitive triple it is a multiple of. Tick Primitive triples only to hide the multiples.
Euclid's formula
Enter two whole numbers m > n. The generator turns them into a triple, checks it and explains whether it is primitive.
Check numbers
Enter any three numbers in any order. The checker squares them and tells you whether they form a Pythagorean triple, a right triangle with non-whole sides, or neither, and in that case whether the triangle is acute or obtuse.
Triples with n
Enter one whole number to find every triple that contains it, as a leg or as the hypotenuse, with the factor pairs that produce them.

Every result updates the page address, so you can bookmark a list or send a link to a specific check.

Primitive triples and their multiples

Multiply every number in a triple by the same whole number and you get another triple: (3, 4, 5) gives (6, 8, 10), (9, 12, 15) and so on forever. A triple whose three numbers share no common factor is called primitive. Every triple is a whole-number multiple of exactly one primitive triple, which is why the generator labels non-primitive rows like "3 × (3, 4, 5)".

Primitive triples follow a few patterns that you can check in any list the generator makes:

  • The hypotenuse c is always odd, and exactly one leg is even.
  • One leg is a multiple of 3 and one leg is a multiple of 4.
  • One of the three numbers is a multiple of 5.

Together these mean the product abc of any Pythagorean triple is divisible by 60. For (3, 4, 5) the product is exactly 60.

How the generator builds triples: Euclid's formula

Pick two whole numbers m > n > 0 and compute

a = m2 − n2  b = 2mn  c = m2 + n2

The result is always a triple, because (m2 − n2)2 + (2mn)2 = m4 + 2m2n2 + n4 = (m2 + n2)2. 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 list mode simply runs through all valid pairs and multiplies each result up to your limit. The full story, including a proof, is on the Euclid's formula page.

mna = m² − n²b = 2mnc = m² + n²Primitive?
21345Yes
3251213Yes
4115817Yes
4372425Yes
52212029Yes
5494041Yes
318610No: both odd, so it is 2 × (4, 3, 5)
42121620No: common factor 2, so it is 4 × (3, 4, 5)
n = 1n = 2n = 3n = 4n = 5n = 6n = 7n = 8m = 25m = 31013m = 4172025m = 526293441m = 63740455261m = 7505358657485m = 86568738089100113m = 982859097106117130145primitiveboth odd: halve itcommon factor
Each cell shows the hypotenuse c = m² + n². Only the green pairs give primitive triples. Notice that 65 and 85 appear twice: each is the hypotenuse of two different primitive triples.

Euclid's formula is not the only way to organize the triples. All primitive triples also grow from (3, 4, 5) in a single infinite tree of primitive triples, where each one has exactly three children.

How the checker decides

Checking a triple is the converse of the Pythagorean theorem in action. The checker sorts the three numbers, squares the two smaller ones, adds them and compares the sum with the square of the largest:

  • Equal and all whole numbers: a Pythagorean triple. For (20, 21, 29), 400 + 441 = 841 = 292.
  • Equal but not all whole: a right triangle, but not a triple. (1.5, 2, 2.5) works, because 2.25 + 4 = 6.25, but triples must be whole numbers. Multiply by 2 to get (3, 4, 5).
  • Sum larger than the square of the largest: the triangle is acute. For (4, 5, 6), 16 + 25 = 41 > 36.
  • Sum smaller: the triangle is obtuse, or, if the two smaller numbers add up to no more than the largest, there is no triangle at all.

The acute and obtuse cases are explained on the acute, obtuse and right triangles page. To test triangles with decimal sides, the right triangle checker is the better tool.

Finding every triple that contains a number

Suppose you want every triple in which 8 is a leg. Rearranging a2 + b2 = c2 gives a2 = c2 − b2 = (c − b)(c + b). So you split a2 into two factors, c − b and c + b, that are both even or both odd, and solve for b and c. The picture shows why the factoring works.

c = 17 b = 15 b² = 225 c² − b² = 289 − 225 = 64 → 17 15 c + b = 32 2 (c − b)(c + b) = 2 × 32 = 64 64 = 8², so a = 8
The L-shaped strip between c2 and b2 has area a2. Cut into two pieces and laid end to end, it is a rectangle of width c − b and length c + b.

For a = 8: 64 = 2 × 32 gives b = 15, c = 17, and 64 = 4 × 16 gives b = 6, c = 10. The pair 1 × 64 is ruled out because 1 is odd and 64 is even. So 8 is a leg of exactly two triples, (8, 15, 17) and (6, 8, 10). To find triples where the number is the hypotenuse, the tool tests every possible leg below n/√2.

Two facts make this search interesting:

  • Every whole number from 3 up is a leg of at least one triple. An odd n gives (n, n2 − 1 over 2, n2 + 1 over 2), such as (7, 24, 25). An even n gives (n, n2 over 4 − 1, n2 over 4 + 1), such as (12, 35, 37). Only 1 and 2 are in no triple.
  • Not every number can be a hypotenuse. A whole number is the hypotenuse of some triple exactly when it has a prime factor that leaves remainder 1 when divided by 4, such as 5, 13, 17 or 29. So 25 and 65 are hypotenuses, but 12, 21 and 49 never are.

How many Pythagorean triples are there?

Infinitely many, because every primitive triple has infinitely many multiples, and Euclid's formula produces infinitely many primitive triples. Up to a fixed limit they are surprisingly sparse. These counts come straight from the generator:

Hypotenuse up toAll triplesPrimitive triplesLimit ÷ 2π
100521615.9
5003868079.6
1,000881158159.2
2,0001,981319318.3

The last column is not a coincidence. A classical result in number theory says the number of primitive triples with hypotenuse up to N is approximately N/2π, and the approximation gets better as N grows. If you just want the common triples printed out, the list of Pythagorean triples has them in a printable chart, and the Pythagorean triples guide explains where they show up in geometry and history, including the Babylonian tablet Plimpton 322.

Frequently asked questions

What is the formula for generating Pythagorean triples?

Euclid's formula: for whole numbers m > n > 0, the numbers m2 − n2, 2mn and m2 + n2 form a triple. With m = 5 and n = 2 you get (21, 20, 29). Choose m and n with no common factor and not both odd to get primitive triples.

What is the smallest Pythagorean triple?

(3, 4, 5). It is the only triple whose numbers are consecutive whole numbers, and every other triple has a larger hypotenuse. Its multiples, such as (6, 8, 10), are the next ones you meet.

Is (1.5, 2, 2.5) a Pythagorean triple?

No. The sides do make a right triangle, since 1.52 + 22 = 2.52, but a Pythagorean triple must be made of positive whole numbers. Doubling every side gives the triple (3, 4, 5).

How many Pythagorean triples have a hypotenuse up to 100?

There are 52 triples with c ≤ 100, and 16 of them are primitive. Set the limit to 100 in the list mode to see them all, or tick the primitive box to see only the 16.

Can a Pythagorean triple have two equal legs?

No. If both legs were a, the hypotenuse would be a√2, which is never a whole number because √2 is irrational. That is why the 45-45-90 triangle never has all-whole sides; the proof is on the square root of 2 is irrational page.

Do triples exist for cubes, like a³ + b³ = c³?

No. For any power higher than 2 there are no positive whole-number solutions to an + bn = cn. This is Fermat's Last Theorem, finally proved by Andrew Wiles in the 1990s.

Keep exploring