Report

Help us improve this tool

Pythagorean Triples Calculator

Check if three numbers form a Pythagorean triple, generate triples via Euclid's formula, and find all right-triangle triples containing a specific side.

O M T

What is a Pythagorean Triple?

A Pythagorean triple consists of three positive integers $(a, b, c)$ such that:

$$a^2 + b^2 = c^2$$

By the Pythagorean theorem, these three integers represent the exact side lengths of a right-angled triangle, where $a$ and $b$ are the perpendicular legs and $c$ is the hypotenuse. The most well-known Pythagorean triple is $(3, 4, 5)$, since $3^2 + 4^2 = 9 + 16 = 25 = 5^2$. If you need to calculate floating-point side lengths or angles for any right triangle, explore our pythagorean calculator.

Primitive vs. Non-Primitive Triples

A Pythagorean triple $(a, b, c)$ is classified as a Primitive Pythagorean Triple (PPT) if $a$, $b$, and $c$ are mutually coprime, meaning their greatest common divisor is 1:

$$\gcd(a, b, c) = 1$$

Any multiple of a primitive triple is also a valid Pythagorean triple, but not primitive. For instance, multiplying $(3, 4, 5)$ by 2 gives $(6, 8, 10)$, since $6^2 + 8^2 = 36 + 64 = 100 = 10^2$. Here $\gcd(6, 8, 10) = 2$, so $(6, 8, 10)$ is non-primitive.

Euclid's Formula for Generating Triples

Euclid discovered a universal formula in his Elements (Book X) to generate all primitive Pythagorean triples using two positive integers $m$ and $n$ with $m > n$:

  • Leg 1: $a = m^2 - n^2$
  • Leg 2: $b = 2mn$
  • Hypotenuse: $c = m^2 + n^2$

The triple $(a, b, c)$ generated by Euclid's formula is primitive if and only if $m$ and $n$ are coprime ($\gcd(m, n) = 1$) and have opposite parity (one is odd, the other is even).

Table of Common Primitive Pythagorean Triples

m n Triple (a, b, c) Perimeter Area
2 1 (3, 4, 5) 12 6
3 2 (5, 12, 13) 30 30
4 1 (8, 15, 17) 40 60
4 3 (7, 24, 25) 56 84
5 2 (20, 21, 29) 70 210

Frequently Asked Questions

What is the smallest Pythagorean triple?

The smallest Pythagorean triple in positive integers is $(3, 4, 5)$, where $3^2 + 4^2 = 9 + 16 = 25 = 5^2$.

Can two numbers in a primitive Pythagorean triple both be even?

No. In every primitive Pythagorean triple $(a, b, c)$, exactly one leg is odd, one leg is even, and the hypotenuse is always odd. If two numbers were even, then all three would be even, which would make $\gcd(a, b, c) \ge 2$, violating the definition of a primitive triple.

Is the area of a Pythagorean triangle always an integer?

Yes. Since one of the legs is always even, the area $A = \frac{1}{2}ab$ is always a positive integer. In fact, the area of any Pythagorean triangle is always divisible by 6.

How many Pythagorean triples exist?

There are infinitely many primitive Pythagorean triples, and therefore infinitely many Pythagorean triples overall.