Saved

Press the star next to a tool's name to save it.

All my tools

Pythagorean Triples Calculator

Use this Pythagorean triples calculator to check a triple, find the missing side, make triples with Euclid's formula, and list all triples that contain a number.

Restored your last values ·

To check a triple, enter all three sides. To find a missing side, enter any two of them and leave the third blank. Euclid's formula makes a triple from two whole numbers m and n. The search finds every triple that has your number as a leg or as the hypotenuse, and the list shows all the primitive triples up to a size.

Everything is worked out in your browser. Nothing you type is sent anywhere.

–

–

Choose what you want, enter the numbers, then press Calculate.

See full result

A Pythagorean triples calculator checks whether three whole numbers form a right triangle, finds the missing side when two are given, makes triples from Euclid's formula, finds every triple that contains a number you choose, and lists the primitive triples up to a size. Choose what you want, enter the numbers and press the button. It runs in your browser with exact whole-number arithmetic.

How to use the Pythagorean triples calculator

  1. Choose Check a triple, Euclid's formula, Find all triples or List the primitive triples.
  2. Enter the sides, or m and n, or the number to look for.
  3. Press Calculate.

What a Pythagorean triple is

The Wikipedia article on Pythagorean triples defines one as three positive integers a, b and c such that a² + b² = c², written (a, b, c), with (3, 4, 5) as the best-known example.[1] A primitive triple is one in which a, b and c are coprime, which means that they have no common divisor larger than 1.[1] The page says that if (a, b, c) is a triple, so is (ka, kb, kc) for any positive integer k, and that every triple is a multiple of a primitive one. For example, (6, 8, 10) is not primitive, because it is 2 × (3, 4, 5).[1] When you check a triple, the calculator says whether it is primitive, and if it is not, it shows the primitive triple that it comes from.

Euclid's formula

The page gives Euclid's formula: for integers m > n > 0, the numbers a = m² − n², b = 2mn and c = m² + n² form a Pythagorean triple. With m = 2 and n = 1, it gives (3, 4, 5).[1] The triple is primitive if and only if m and n are coprime and exactly one of them is even. If both are odd, then a, b and c are all even.[1] So m = 5 and n = 2 give (21, 20, 29), which is the primitive triple (20, 21, 29), while m = 3 and n = 1 give (8, 6, 10), which is twice (3, 4, 5). The page says that the form with a free multiplier k, a = k(m² − n²), b = k(2mn), c = k(m² + n²), covers every triple, and that (9, 12, 15) cannot be made without the k.[1] The calculator has a box for k.

The first primitive triples

The page lists the first primitive triples as (3, 4, 5), (5, 12, 13), (8, 15, 17), (7, 24, 25), (20, 21, 29), (12, 35, 37) and (9, 40, 41), and its full list of the primitive triples with a hypotenuse up to 100 continues with (28, 45, 53), (11, 60, 61), (16, 63, 65), (33, 56, 65), (48, 55, 73), (13, 84, 85), (36, 77, 85), (39, 80, 89) and (65, 72, 97).[1] That is 16 primitive triples. Enter 100 in the list mode and the calculator gives the same 16, in order of the hypotenuse. Up to 1,000 there are 158. The page also notes that exactly one of the two legs is even and that the hypotenuse is always odd in a primitive triple.[1]

Finding every triple that contains a number

To find the triples with a given leg, write the square of the leg as a product of two numbers, c − b and c + b, that are both even or both odd. For the leg 12, the square is 144, and the pairs (2, 72), (4, 36), (6, 24) and (8, 18) give the triples (12, 35, 37), (12, 16, 20), (9, 12, 15) and (5, 12, 13). The calculator does this for any number up to a million, and it also searches for the triples that have the number as the hypotenuse. For 25 it finds (7, 24, 25) and (15, 20, 25) as hypotenuse, and (25, 60, 65) and (25, 312, 313) as a leg. The page says that for every positive integer k there are at least k different triples with the same hypotenuse.[1]

Which numbers can be a hypotenuse

The page states that a positive integer c is the hypotenuse of a primitive triple if and only if each of its prime factors is congruent to 1 modulo 4, and that the number of primitive triples with the legs in order for such a c is 2^(k − 1), where k is the number of distinct prime factors of c.[1] The number 65 = 5 × 13 has two such prime factors, so it has 2 primitive triples, (16, 63, 65) and (33, 56, 65), and these appear in the list above. The number 25 has the one prime factor 5, so it has 1 primitive triple, (7, 24, 25). It also has a multiple triple, (15, 20, 25).

Finding a missing side

If you know two sides, the third follows from a² + b² = c². Enter 3 and 4 as the legs and the hypotenuse is 5. Enter the leg 5 and the hypotenuse 13, and the other leg is 12. If the missing side is not a whole number, as for legs of 1 and 1, where the hypotenuse is about 1.41421, the sides are not a Pythagorean triple, and the calculator says so, but it still shows the length of the third side.

Uses of Pythagorean triples

Triples are handy whenever you need a right angle without measuring one. Builders use the 3-4-5 rule: mark 3 units along one line and 4 units along the other, and if the distance between the marks is 5, the corner is square. Teachers use triples such as (5, 12, 13) and (8, 15, 17) so that a problem has whole-number answers. In number theory, triples lead to deep questions about integer solutions of equations. Use the list mode to find triples with a hypotenuse that fits your project, such as the largest one under 200.

Common mistakes

  • Putting the hypotenuse in a leg box. The hypotenuse is always the longest side.
  • Calling (6, 8, 10) primitive. It has the common factor 2.
  • Using m and n with the same parity. That makes every side even.
  • Allowing non-integers. A triple needs whole numbers.

What next

Use this often? Add Pythagorean to your Home screen.

Frequently asked questions

What is a Pythagorean triples calculator?

A tool that checks whether three whole numbers satisfy a² + b² = c², finds missing sides, and generates triples.

What is a primitive Pythagorean triple?

One in which a, b and c have no common divisor larger than 1, such as (3, 4, 5). (6, 8, 10) is not primitive.

What is Euclid's formula?

For m > n > 0, a = m² − n², b = 2mn and c = m² + n² form a triple. It is primitive when m and n are coprime and exactly one is even.

How many primitive triples have a hypotenuse up to 100?

Sixteen, starting with (3, 4, 5), (5, 12, 13) and (8, 15, 17) and ending with (65, 72, 97).

Can every number be in a Pythagorean triple?

Every number above 2 is a leg of some triple. A hypotenuse of a primitive triple must have only prime factors that are 1 more than a multiple of 4.

What went wrong?

We only receive the reason you pick, never what you typed into the tool.

Thanks for your feedback.

More Math Tools