🧮
🧮 Math & statistics

Pythagorean Triples Calculator (Euclid’s formula generator & triple checker)

Results update as you type.

Your numbers

Understanding the Pythagorean triples calculator — concept and principle

This calculator generates Pythagorean triples with Euclid's formula, or checks whether three whole numbers form one. It reports whether the triple is primitive, the Euclid parameters, and the perimeter, area and inradius of the right triangle. Use it for number theory, geometry homework, puzzle design and setting out right angles with whole-number lengths.

The 8-15-17 Pythagorean tripleEuclid: m = 4, n = 1b = 15a = 8c = 17m² − n² = 152mn = 8m² + n² = 1764 + 225 = 289primitive · area 60
m = 4 and n = 1 build the right triangle 8, 15, 17, since 8² + 15² = 17².

How it is calculated

The principle

Euclid's formula works by algebra: (m² − n²)² + (2mn)² = m⁴ − 2m²n² + n⁴ + 4m²n² = m⁴ + 2m²n² + n⁴ = (m² + n²)². So any m > n gives a valid triple. Every primitive triple arises this way from exactly one pair of coprime m, n of opposite parity, and every other triple is a whole-number multiple of a primitive one. In a primitive triple one leg is even and the other odd, and the hypotenuse is always odd. The inradius of any right triangle is (a + b − c)/2, which is a whole number for every Pythagorean triple.

Worked example

Default inputs: generate mode, m = 4, n = 1, k = 1.

  1. a = 4² − 1² = 15, b = 2 × 4 × 1 = 8, c = 4² + 1² = 17.
  2. Sorted: (8, 15, 17). Check: 64 + 225 = 289 = 17².
  3. gcd(4, 1) = 1 and 4 is even, so the triple is primitive.
  4. Perimeter = 8 + 15 + 17 = 40; area = 8 × 15 ÷ 2 = 60.
  5. Inradius = (8 + 15 − 17) ÷ 2 = 3.

How to read the result

"Yes — a Pythagorean triple" means the three lengths make an exact right triangle. "Primitive" means it is not a scaled copy of a smaller triple; (6, 8, 10), for example, is 2 × (3, 4, 5). The Euclid parameters let you reproduce the triple or find related ones. In check mode, a "no" means no right triangle has exactly those whole-number sides.

Common mistakes

Keep in mind: Builders use 3-4-5 to check right angles, but measuring errors add up. For setting out real structures, follow standard surveying practice and local requirements.

Frequently asked questions

What are the smallest Pythagorean triples?

(3, 4, 5), (5, 12, 13), (8, 15, 17) and (7, 24, 25) are the first primitive ones.

Are there infinitely many?

Yes. Every pair m > n gives one, so there are infinitely many, including infinitely many primitive ones.

Can all three numbers be odd?

No. If a and b were both odd, a² + b² would leave remainder 2 when divided by 4, which no square does.

Sources: Weisstein, E. W., "Pythagorean Triple", Wolfram MathWorld

Checked 9 Nov 2026. Pythagorean triple — Wikipedia (consulted 9 Nov 2026): Euclid’s formula a = m² − n², b = 2mn, c = m² + n² for m > n > 0; the triple is primitive if and only if m and n are coprime and exactly one of them is even; every triple is a positive multiple of a primitive one.

🧮 All math & statistics tools →🌍 Calculators by country →