Maths & numbers

Primitive Pythagorean triples calculator with a hypotenuse limit

Enumerate positive integer right triangles below a hypotenuse cutoff, keeping primitive triples or including all positive integer multiples on the same page.

Your numbers

Enter a base-ten integer without commas, decimals or scientific notation.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

A Pythagorean triple consists of positive integer side lengths satisfying a²+b²=c². This page generates primitive seeds from Euclid’s coprime opposite-parity parameters and applies the exact requested hypotenuse cutoff. The primitive-only mode returns scale one. The all-triples mode adds each positive multiple that still fits the same cutoff. Legs are sorted so exchanging them does not create duplicate rows, and Euclid parameters always refer to the underlying primitive seed.

THE FORMULAa=m²−n², b=2mn, c=m²+n² for coprime m>n>0 of opposite parity; multiply primitive seeds by positive integer scales if requested.

A worked example

With maximum hypotenuse thirty, the primitive triples are (3,4,5), (5,12,13), (8,15,17), (7,24,25) and (20,21,29). The first comes from m=2,n=1: the legs are 2²−1²=3 and 2*2*1=4, with hypotenuse five. Selecting multiples also includes (6,8,10), whose row has the same seed parameters and scale two. It is valid but not primitive because all three sides share a factor of two.

Good to know

The hypotenuse limit is a whole number from one through 20,000. Side lengths are positive, with the shorter leg first. Negative signs, exchanged leg order and zero-length degeneracies are not separate outputs. A result table is limited to 50,000 rows. Euclid parameters are seed parameters even on scaled rows. This enumerates a bounded integer family, rather than finding one unknown side from measured lengths or generating every right triangle over real numbers.

Coprimality and opposite parity make the parameterization primitive

The raw formulas produce integer right triangles for any positive m>n, but they do not always produce primitive ones. A common factor in m,n introduces a common factor in the sides, and two odd parameters make both legs even. Restricting the pair to coprime values of opposite parity removes those repetitions and gives the unique primitive seed with one even leg. Sorting the two legs afterward changes presentation, not the seed construction.

For m=3,n=2, the raw legs are five and twelve and the hypotenuse is thirteen. For m=4,n=1, the raw legs are fifteen and eight, which display as (8,15,17). An entered cutoff of sixteen includes the first of those triples but excludes the second even though its shorter leg is only eight. The form’s limit concerns c specifically, so a perimeter cutoff or a maximum-leg cutoff would require a different inclusion rule.

The smallest primitive triple comes from coprime parameters two and one435m = 2; n = 1gcd(m,n) = 1Opposite parityScale 1: primitive; scale 2: (6,8,10)
With m=2,n=1, the generated legs are 3 and 4 and the hypotenuse is 5. The diagram uses those length proportions. Scaling by two gives (6,8,10), which is not primitive and appears only in the multiples mode.

The Sum of two squares calculator for integer representations fixes the sum n and lists coordinate pairs instead of enumerating right triangles under a hypotenuse cutoff.

Scaled rows preserve the original primitive seed without counting leg permutations

Every positive integer right triangle is a positive multiple of a primitive triple. The all-triples mode therefore scales each seed up to floor(limit/c), keeping its m,n labels and reporting the scale separately. Recomputing arbitrary new Euclid parameters for each multiple can create duplicate routes to the same side lengths. The explicit seed-and-scale representation avoids that ambiguity and explains why a scaled row may have a common side divisor.

A table count depends on whether signs, leg order or primitive status are distinguished. Here (3,4,5) and (4,3,5) are one row, and negative-side versions are not physical positive triangles. At a cutoff below five the result is correctly empty, rather than filled with a zero-leg solution. The total primitive count remains available in all-triples mode, so the size of the seed catalogue is not confused with the larger list created by scaling.

A few questions, answered

Are equal positive legs possible in an integer Pythagorean triple?

No. Equal nonzero integer legs would require an integer hypotenuse equal to the leg times √2. This page still sorts all legs consistently, without creating a special equal-leg row.

Can I use the output with metres or centimetres?

The triples are dimensionless integer ratios. Multiplying all three lengths by one common physical unit scale produces similar right triangles, but the calculator does not attach measurement precision to those lengths.

Find your calculator

Start typing to explore the library.