Pythagorean Triples Calculator
This calculator has two modes. In Verify mode, enter three positive integers and the calculator checks instantly whether they satisfy a² + b² = c², tells you which side is the hypotenuse, and flags whether the triple is primitive. In Generate mode, enter two coprime parameters m and n (with m greater than n) plus an optional scaling factor k to produce any Pythagorean triple using Euclid's formula. Both modes show the full working and a scaled triangle diagram.
What is a Pythagorean triple?
A Pythagorean triple is a set of three positive integers (a, b, c) that satisfy the Pythagorean theorem: a² + b² = c². The integers represent the side lengths of a right triangle with legs a and b and hypotenuse c. The most famous example is (3, 4, 5): 9 + 16 = 25. Multiples of any triple are also triples, so (6, 8, 10), (9, 12, 15), and (30, 40, 50) are all valid because they are just scaled-up versions of (3, 4, 5). A triple where the three sides share no common factor greater than 1 is called a primitive Pythagorean triple, and every non-primitive triple is a whole-number multiple of some primitive.
How to verify a Pythagorean triple
To check whether three integers (a, b, c) form a Pythagorean triple, sort them so the largest is c, then compute a² + b² and compare it to c². If the two values are exactly equal, you have a valid triple. Because all three must be integers, this comparison is exact with no rounding. You can then find the GCD of all three sides: if it is 1, the triple is primitive; if it is greater than 1, dividing each side by the GCD gives the primitive triple it is derived from.
Generating triples with Euclid's formula
Around 300 BC, Euclid showed that every primitive Pythagorean triple can be generated from two positive integers m and n where m > n, gcd(m, n) = 1, and exactly one of m or n is even. The formulas are: a = m² - n², b = 2mn, c = m² + n². Multiplying all three sides by a scaling factor k gives the non-primitive family: a = (m² - n²)k, b = 2mnk, c = (m² + n²)k. For example, m = 2, n = 1 gives (3, 4, 5). Setting k = 2 gives (6, 8, 10), a non-primitive triple. Setting m = 3, n = 2 gives (5, 12, 13). The formula covers every primitive triple without repetition, and together with all integer multiples, accounts for every Pythagorean triple there is.
Properties and patterns of Pythagorean triples
Pythagorean triples have several notable properties. In every primitive triple, exactly one leg is even and one is odd, and the hypotenuse is always odd. The even leg is always divisible by 4, and exactly one of the three sides is divisible by 3, exactly one by 4, and exactly one by 5. The area of the right triangle with sides (a, b, c) is always a whole number for integer triples. There are infinitely many primitive Pythagorean triples, a fact Euclid proved by showing the generating formula works for any valid m and n pair. Triples are also related to Pythagorean sums: every odd number n greater than 1 is the shorter leg of some primitive triple, with b = (n² - 1) / 2 and c = (n² + 1) / 2 when n is odd.
Common primitive Pythagorean triples
| a (leg) | b (leg) | c (hypotenuse) | m | n |
|---|---|---|---|---|
| 3 | 4 | 5 | 2 | 1 |
| 5 | 12 | 13 | 3 | 2 |
| 8 | 15 | 17 | 4 | 1 |
| 7 | 24 | 25 | 4 | 3 |
| 20 | 21 | 29 | 5 | 2 |
| 9 | 40 | 41 | 5 | 4 |
| 12 | 35 | 37 | 6 | 1 |
| 11 | 60 | 61 | 6 | 5 |
| 28 | 45 | 53 | 7 | 2 |
| 33 | 56 | 65 | 7 | 4 |
| 36 | 77 | 85 | 9 | 2 |
| 13 | 84 | 85 | 7 | 6 |
| 60 | 91 | 109 | 10 | 3 |
| 15 | 112 | 113 | 8 | 7 |
| 20 | 99 | 101 | 10 | 1 |
| 60 | 11 | 61 | 6 | 5 |
| 65 | 72 | 97 | 9 | 4 |
All primitive triples (a, b, c) with hypotenuse c under 200, generated by Euclid's formula with gcd(m, n) = 1 and opposite parity.
Frequently asked questions
What is the smallest Pythagorean triple?
The smallest Pythagorean triple is (3, 4, 5). It satisfies 3² + 4² = 9 + 16 = 25 = 5². It is also primitive because gcd(3, 4, 5) = 1. Every triple of the form (3k, 4k, 5k) for any positive integer k is also valid, so (6, 8, 10), (9, 12, 15), and so on are all Pythagorean triples.
What is the difference between a primitive and a non-primitive Pythagorean triple?
A primitive triple has no common factor among its three sides other than 1, for example (3, 4, 5) or (5, 12, 13). A non-primitive triple is a whole-number multiple of a primitive, such as (6, 8, 10) = 2 x (3, 4, 5). Every non-primitive triple can be reduced to its primitive form by dividing all sides by their GCD. There are infinitely many of both types.
How does Euclid's formula generate Pythagorean triples?
Choose two positive integers m and n with m greater than n. The formulas a = m² - n², b = 2mn, and c = m² + n² always produce a valid Pythagorean triple. The result is primitive when gcd(m, n) = 1 and m and n have opposite parity (one even and one odd). Multiplying all three sides by a positive integer k scales the triple without breaking the Pythagorean condition.
Can all three sides of a Pythagorean triple be odd?
No. In any Pythagorean triple, at least one side must be even. In a primitive triple, exactly one leg is even and one is odd, and the hypotenuse is always odd. You cannot have all three sides even in a primitive triple either, because dividing by 2 would give a smaller triple, contradicting primitivity.
Are there infinitely many Pythagorean triples?
Yes. For any primitive triple (a, b, c), multiplying by any positive integer k gives another valid triple (ak, bk, ck). Since there are infinitely many primitive triples - generated by Euclid's formula for all valid m and n pairs - and infinitely many multiples of each, the total count is infinite. There is also a Pythagorean triple for every odd integer n greater than 1, confirming no finite list can ever be complete.
How is a Pythagorean triple used in real life?
Builders and carpenters use the (3, 4, 5) triple to check that corners are exactly 90 degrees. By measuring 3 units along one wall and 4 units along an adjacent wall, if the diagonal is exactly 5 units the corner is square. The same principle applies in surveying, tile laying, and structural engineering. Navigation and GPS also rely on right-triangle geometry, and Pythagorean triples appear in cryptography when working with certain modular arithmetic problems.