Percentages and Math

Pythagorean Triples Generator

Set a size limit or a known leg to list right triangles whose three sides are whole numbers.

Your numbers

Find

A whole number from 5 to 5,000. Example value.

Result

Triples with hypotenuse up to 100

16

16 are primitive (no common factor).

Triples found
16
Primitive triples
16
Smallest hypotenuse
5

Right triangles with whole-number sides

Leg aLeg bHypotenuse cEuclid m, nKind
3452, 1primitive
512133, 2primitive
815174, 1primitive
724254, 3primitive
2021295, 2primitive
1235376, 1primitive
940415, 4primitive
2845537, 2primitive
1160616, 5primitive
1663658, 1primitive
3356657, 4primitive
4855738, 3primitive
1384857, 6primitive
3677859, 2primitive
3980898, 5primitive
6572979, 4primitive
How this was calculated
  1. Euclid's formula makes every primitive triple from two numbers m > n that have no common factor and are not both odd: a = m^2 - n^2, b = 2mn, c = m^2 + n^2.
  2. Every pair with c = m^2 + n^2 up to 100 is generated; multiples of each triple can be added by scaling all three sides.
  3. Each result is checked: a^2 + b^2 = c^2, and a triple is primitive when the greatest common divisor of its sides is 1.

Calculated using SumPanda.com · https://sumpanda.com/pythagorean-triples-generator/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the pythagorean triples generator

  1. Choose Triples up to a size and enter the largest hypotenuse (from 5 to 5,000), or choose Triples with a leg and enter a known leg (from 3 to 1,000,000).
  2. For a size limit, tick the box to include multiples of the basic triples, such as 6, 8, 10 from 3, 4, 5.
  3. Read the count of triples and how many are primitive, which means the three sides share no common factor.
  4. The table shows each triple with the Euclid numbers m and n that produce it. Only the first 300 rows are shown, and the CSV has them all.

Formula

for whole numbers m > n with no common factor and not both odd:

a = m^2 - n^2, b = 2 x m x n, c = m^2 + n^2

every primitive triple comes from exactly one such pair

for a known leg: (c - b)(c + b) = leg^2, so factor pairs of leg^2 give the triangles

A triple is primitive when the greatest common divisor of a, b and c is 1. Every other triple is a primitive triple with all three sides multiplied by the same whole number.

Triples up to 50 and 100, and a leg of 12

Up to a hypotenuse of 50 there are 20 triples, of which 7 are primitive: 3-4-5, 5-12-13, 8-15-17, 7-24-25, 20-21-29, 12-35-37 and 9-40-41. Up to 100 there are 52 triples with multiples included, and 16 primitive ones. Up to 200 the counts are 127 and 32. A brute force check of all pairs of legs gave the same counts.

The right triangles with a leg of 12 are 5-12-13, 9-12-15, 12-16-20 and 12-35-37. Only 5-12-13 and 12-35-37 are primitive. A leg of 7 appears only in 7-24-25, and a leg of 3 only in 3-4-5. For a leg of 12, the factor pairs of 144 with the same parity give the four triangles.

Why Euclid's formula finds them all

Any right triangle with whole-number sides can be scaled down to one with no common factor, and Euclid's formula describes every such triangle with the two numbers m and n. The condition that m and n have no common factor and are not both odd makes sure the triple is primitive and that no triple is counted twice. For a hypotenuse up to a limit, the tool tries all m and n whose sum of squares fits.

Uses of the triples

Triples are handy in the workshop and in the classroom: a 3-4-5 triangle squares a corner, and a list lets a teacher write problems whose answers are whole numbers. To check one triangle or find a missing side, use the Pythagorean Theorem Calculator, and to solve any triangle use the Triangle Calculator.

More tools for playing with numbers

For more number patterns and conversions, try the Collatz Sequence Calculator, Egyptian Fraction Decomposer and Gray Code Converter.

Assumptions and limits

  • The sides are positive whole numbers that satisfy a squared plus b squared equals c squared.
  • The two legs are listed with the shorter one first, and each triangle is listed once.
  • The hypotenuse limit is a whole number from 5 to 5,000, and the known leg from 3 to 1,000,000.
  • Only the first 300 rows are shown on the page, but the counts and the CSV cover all of them.
  • The limit and leg in the form are examples to replace with your own.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

What is a primitive triple?

It is a triple whose sides have no common factor except 1. 3-4-5 is primitive and 6-8-10 is not, since all three sides can be divided by 2.

Are there triples with every leg?

Every whole number from 3 up appears as a leg of at least one right triangle with whole-number sides. Some numbers, such as 3, 4, 5 and 7, have only one, while numbers with many factors have many.

Why can the number of rows be large?

With multiples included, a limit of 5,000 gives thousands of triples. The page shows the first 300 so that it stays readable and keeps the whole list in the CSV download.

Is there a triple where the two legs differ by 1?

Yes, such as 3-4-5 and 20-21-29. There are infinitely many of them, and they are found by a pattern in m and n.