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 + n2The 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.
| m | n | a = m² − n² | b = 2mn | c = m² + n² | Primitive? |
|---|---|---|---|---|---|
| 2 | 1 | 3 | 4 | 5 | Yes |
| 3 | 2 | 5 | 12 | 13 | Yes |
| 4 | 1 | 15 | 8 | 17 | Yes |
| 4 | 3 | 7 | 24 | 25 | Yes |
| 5 | 2 | 21 | 20 | 29 | Yes |
| 5 | 4 | 9 | 40 | 41 | Yes |
| 3 | 1 | 8 | 6 | 10 | No: both odd, so it is 2 × (4, 3, 5) |
| 4 | 2 | 12 | 16 | 20 | No: common factor 2, so it is 4 × (3, 4, 5) |
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.
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 to | All triples | Primitive triples | Limit ÷ 2π |
|---|---|---|---|
| 100 | 52 | 16 | 15.9 |
| 500 | 386 | 80 | 79.6 |
| 1,000 | 881 | 158 | 159.2 |
| 2,000 | 1,981 | 319 | 318.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
- TriplesPythagorean TriplesWhat Pythagorean triples are, the common ones to know (3-4-5, 5-12-13, 8-15-17…), how to generate and recognize them, and the patterns every triple shares.
- TriplesList of Pythagorean TriplesComplete, computer-checked list of Pythagorean triples: all 52 with hypotenuse up to 100 and all 47 primitive triples up to 300, with m, n, perimeter and area.
- TriplesEuclid's Formula for Pythagorean TriplesEuclid's formula a = m² − n², b = 2mn, c = m² + n² explained: two derivations, a table for m ≤ 8, when the triple is primitive, and four other classic generators.
- TriplesPrimitive Pythagorean TriplesWhat makes a Pythagorean triple primitive, the quick gcd test, why exactly one leg is even, and a full proof that Euclid's formula gives every primitive triple.
- TriplesThe Tree of Primitive Pythagorean TriplesThe Berggren tree builds every primitive Pythagorean triple exactly once from 3-4-5 using three matrices. See the tree to depth 3, worked examples and the proof.
- CalculatorsIs It a Right Triangle? Checker and Triangle ClassifierIs it a right triangle? Enter three side lengths to check the triangle inequality, classify the triangle as right, acute or obtuse, and find all three angles.