Skip to content
D DocNectar

Free Pythagorean Triples Calculator

Check if three numbers form a Pythagorean triple, generate one from Euclid's formula, or list primitive triples.

100% Free No Signup Works on all devices

Last updated October 4, 2026 · Report an error

Thanks for rating!

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.

  1. Enter mode.
  2. Enter a (leg).
  3. Enter b (leg).
  4. Enter c (hypotenuse).
  5. Enter m (m > n > 0).
  6. Enter n.
  7. Enter how many primitive triples to list.
  8. 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.

Frequently asked questions

When gcd(a,b,c) = 1 — no common factor divides all three. (3,4,5) is primitive; (6,8,10) is not, since it's just (3,4,5) scaled by 2.
Yes — every primitive Pythagorean triple can be generated from some coprime m > n of opposite parity (one even, one odd), and this was proven as a complete characterization of all primitive triples.
If m and n were both even or both odd, the resulting a, b, and c would all share a common factor of 2, meaning the triple wouldn't be primitive — opposite parity is one of the two conditions (along with being coprime) needed to guarantee a primitive result.
Yes — scaling every value in a valid triple by the same positive integer always produces another valid triple, though it won't be primitive unless the scaling factor is 1.
(3, 4, 5) is the smallest and most well-known Pythagorean triple, and it's also primitive.
Builders and carpenters commonly use the 3-4-5 triple (or a scaled multiple like 6-8-10) to check that a corner is a true right angle, since measuring 3 units and 4 units along the two sides and confirming the diagonal measures 5 units confirms a 90° angle without needing a protractor.

Get new calculators and guides in your inbox

No spam — just new tools like Pythagorean Triples Calculator and practical guides.

Favorites