Last updated October 4, 2026 · Report an error
A Pythagorean triple is a set of three positive integers (a, b, c) satisfying a² + b² = c² — the relationship at the heart of the Pythagorean theorem, with the classic example being (3, 4, 5), since 3² + 4² = 9 + 16 = 25 = 5². These triples are useful well beyond abstract number theory: because they describe whole-number right triangles, they show up constantly in construction and carpentry (the "3-4-5 rule" for squaring a corner), in geometry problems designed to have clean integer answers, and in number theory as a classic area of study in their own right. A "primitive" triple is one where a, b, and c share no common factor — (3,4,5) is primitive, while (6,8,10) is not, since it's simply (3,4,5) scaled up by a factor of 2. This tool handles three related tasks: checking whether three given numbers form a valid Pythagorean triple (and whether it's primitive), generating a triple directly from Euclid's formula, and listing the first several primitive triples in order.
How it works
Choose a mode. To check a triple, the tool verifies that a² + b² = c² holds for your three values (after sorting them so c is the largest), then computes the greatest common divisor (GCD) of all three numbers to determine whether it's primitive (GCD = 1) or simply a scaled-up multiple of a smaller triple. To generate a triple, the tool applies Euclid's formula: a = m² − n², b = 2mn, c = m² + n², for any two positive integers m > n — this formula is guaranteed to always produce a valid Pythagorean triple, and produces a primitive one specifically when m and n are coprime (share no common factor) and of opposite parity (one even, one odd). To list triples, the tool works through increasing values of m and n satisfying those primitive conditions, generating triples in order.
- Enter mode.
- Enter a (leg).
- Enter b (leg).
- Enter c (hypotenuse).
- Enter m (m > n > 0).
- Enter n.
- Enter how many primitive triples to list.
- Click Calculate to see your results.
Examples
(3, 4, 5)
3² + 4² = 9 + 16 = 25 = 5², so it's a valid triple — and since gcd(3,4,5) = 1, it's primitive.
Euclid's formula with m=2, n=1
a = 2² − 1² = 3, b = 2(2)(1) = 4, c = 2² + 1² = 5 — generates the (3,4,5) triple, and since 2 and 1 are coprime and of opposite parity, it's primitive.
A non-primitive triple
(6, 8, 10) satisfies 6² + 8² = 36 + 64 = 100 = 10², so it's a valid triple, but gcd(6,8,10) = 2, so it's not primitive — it's just (3,4,5) with every value doubled.
Who should use it
- Checking whether a set of measurements forms a valid right triangle.
- Generating Pythagorean triples for number theory coursework.
- Verifying a right angle in construction using the 3-4-5 rule.
Industry applications
- Mathematics education (number theory)
- Construction and carpentry (squaring corners)
Advantages
- Handles checking, generating, and listing Pythagorean triples in one tool.
- Correctly distinguishes primitive triples from scaled-up multiples.
- Uses Euclid's formula, a complete and exact method for generating primitive triples.
Limitations
- Limited to whole-number (integer) triples — doesn't address non-integer right-triangle side combinations.
Common mistakes to avoid
- Forgetting that m must be greater than n, and that not every (m,n) pair produces a primitive triple unless they're coprime and of opposite parity.
- Assuming any three numbers satisfying a² + b² = c² are automatically primitive, without separately checking their greatest common divisor.
- Mixing up which value should be c (the largest of the three, corresponding to the hypotenuse) when checking a triple.
Best practices
- When generating primitive triples via Euclid's formula, always choose m and n as coprime integers of opposite parity.
- Sort your three numbers from smallest to largest before checking a² + b² = c², so the largest value is correctly treated as c.
- Use the 3-4-5 rule (or a scaled version) as a quick, practical way to verify a right angle in construction or carpentry.
Tips
- The 3-4-5 triple and its multiples (6-8-10, 9-12-15, etc.) are the most practically useful for real-world right-angle checks.
- Remember: opposite parity and coprime m, n together guarantee a primitive triple from Euclid's formula.