Pythagorean Triple Calculator
Check whether three whole numbers form a Pythagorean triple (a² + b² = c²), see if it is primitive and its Euclid parameters m and n, or list every triple up to a given hypotenuse.
How it works
a² + b² = c² with whole numbers a < b < c · Euclid: a = m² − n², b = 2mn, c = m² + n² (m > n > 0, coprime, one even) gives every primitive triple · k·(a, b, c) gives the others
A Pythagorean triple is three positive whole numbers that can be the sides of a right triangle. It is primitive when the three numbers share no common factor; every other triple is a whole-number multiple of a primitive one, such as 6, 8, 10 = 2 × (3, 4, 5). Euclid’s formula generates all primitive triples from two coprime integers m > n of opposite parity. In check mode the numbers can be typed in any order; the largest is taken as the hypotenuse.
Worked example
20, 21, 29: 20² + 21² = 400 + 441 = 841 = 29², so it is a Pythagorean triple, and since gcd(20, 21, 29) = 1 it is primitive. It comes from Euclid’s formula with m = 5, n = 2: 5² − 2² = 21, 2·5·2 = 20 and 5² + 2² = 29.
Sources: Wolfram MathWorld — Pythagorean Triple · OEIS A020882 — Hypotenuses of primitive Pythagorean triangles
Frequently asked questions
What are the most common Pythagorean triples?
3-4-5, 5-12-13, 8-15-17, 7-24-25, 20-21-29 and 9-40-41, plus their multiples such as 6-8-10 and 9-12-15.
How do you generate Pythagorean triples?
Pick whole numbers m > n > 0 and use a = m² − n², b = 2mn, c = m² + n². With m = 2, n = 1 you get 3, 4, 5; with m = 3, n = 2 you get 5, 12, 13.
What is a primitive Pythagorean triple?
One whose three numbers have greatest common divisor 1. Exactly one leg is even and the hypotenuse is always odd.
Can a Pythagorean triple contain two odd legs?
No. If both legs were odd, a² + b² would be 2 more than a multiple of 4, which is never a perfect square.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.