Pythagorean Triples
Pythagorean Triples Calculator
Calculator Mode
Check a Pythagorean triple
Result
Formula:
Pythagorean Triples Calculator
Check whole-number triples and generate new ones with Euclid's formula.
A Pythagorean triple is a set of three positive whole numbers that can serve as the sides of a right triangle. The two shorter numbers are the legs, the largest number is the hypotenuse, and the three values satisfy the Pythagorean theorem.
The Pythagorean Triples Calculator does two jobs. In check mode, you enter three whole numbers and it tests whether they form a valid triple. In generate mode, you enter two integers, and , and it builds a new triple with Euclid's formula. Checking and generating are different tasks, and this page explains both, step by step.
The best-known example is , , and . Squaring and adding the legs gives , which equals . Because the two sides match exactly, is a valid triple. A primitive triple is one whose three numbers share no common factor greater than ; , , and have nothing in common, so is primitive. The sections below show how to check any three numbers, how to generate triples of any size, and how to tell primitive triples from scaled copies.
Check or Generate Pythagorean Triples With the Calculator
Two modes, one page: check a set of numbers, or build a new triple.
Mode 1: Check a Pythagorean Triple
Enter the three side lengths as , , and , with as the largest value. The calculator squares and , adds the results, squares , and compares the two sides of the equation.
When both sides are equal, the three numbers form a valid Pythagorean triple, and the result says so. When they differ, the numbers do not form a triple, and the result shows the two unequal totals so you can see how far off they are. All three inputs must be positive whole numbers, and all three must use the same unit.
Mode 2: Generate Pythagorean Triples
Enter two positive integers, and , with greater than . The calculator applies Euclid's formula to produce three whole-number side lengths.
The result is always a valid triple, because Euclid's formula is built to satisfy the Pythagorean theorem. The two legs may appear in either order, but is always the hypotenuse. To use the calculator, pick a mode, enter valid numbers, click Calculate, and read the result with its step-by-step working. Click Reset to clear the fields and start again.
What Is a Pythagorean Triple?
Three positive whole numbers that fit the Pythagorean theorem exactly.
A Pythagorean triple is a set of three positive integers, written , that satisfy the equation . Here and are the legs, the two sides that meet at the right angle, and is the hypotenuse, the side opposite the right angle and always the longest of the three.
The equation must hold exactly. A near miss is not a triple: if the sum of the squared legs differs from the squared hypotenuse by even one unit, the three numbers fail the test. That strict equality is what makes a triple useful in building and carpentry, where a -- check marks a square corner with no measuring error.
All three numbers must be whole and positive. A right triangle with decimal side lengths, such as legs and with hypotenuse , satisfies the Pythagorean theorem but is not a Pythagorean triple, because the definition requires integers. Likewise, a triangle with an irrational side, such as legs and with hypotenuse , is a right triangle but not a triple. The word triple is reserved for positive integer solutions only.
The triple is the natural first example. Its legs are and , its hypotenuse is , and confirms the equation. The order of the legs does not matter: describes the same triangle. What matters is that the two smaller numbers are the legs and the largest is the hypotenuse.
Understanding the Pythagorean Theorem
The theorem behind every triple: the squares of the legs add to the square of the hypotenuse.
The Pythagorean theorem states that in any right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides. With legs and and hypotenuse , the theorem reads as follows.
One clear way to see it is through areas. Draw a square on each side of the triangle. The square on leg has area , the square on leg has area , and the square on the hypotenuse has area . The theorem says the first two areas add up to the third. For the -- triangle, the squares have areas , , and , and shows the balance directly.
That area picture also explains why -- is a valid right triangle. Its side lengths satisfy the area balance exactly, so the angle between the legs must be a right angle. Every Pythagorean triple satisfies the theorem, because a triple is defined by that equation. The reverse is not true: plenty of right triangles have side lengths that are not whole numbers, so they satisfy the theorem without being triples. Use the Pythagorean theorem calculator when a triangle has decimal or unknown sides instead of whole-number triples.
How to Check Whether Three Numbers Form a Pythagorean Triple
Eight short steps turn any three whole numbers into a clear yes or no.
- Identify the largest of the three values.
- Assign the largest value to , the hypotenuse.
- Assign the other two values to and , the legs.
- Square .
- Square .
- Add the two squares.
- Square .
- Compare the two results: equal means a valid triple, unequal means not a triple.
Here is a valid example. Check , , and : the largest value is , so it is the hypotenuse. Square the legs and add.
Since , the two sides match, so is a valid Pythagorean triple. It is also primitive, because , , and share no common factor greater than .
Now an invalid example. Check , , and : the largest value is , so it is the hypotenuse.
Since does not equal , the values do not form a Pythagorean triple. The same eight steps work for any positive integer inputs, large or small, so exact verification never depends on memory or guesswork.
How to Generate Pythagorean Triples Using Euclid's Formula
Two small integers in, a full triple out: that is Euclid's formula.
Euclid's formula builds a Pythagorean triple from two positive integers, and , with greater than . The parameter is the larger integer and is the smaller one, and both must be whole numbers. The three formulas produce the two legs and the hypotenuse.
The condition matters. If equals , the first leg becomes zero, which is not a triangle side. If is smaller than , the first leg becomes negative, which is also impossible. Decimal values of and are not valid here either, because the formula is designed for integer parameters that produce integer sides.
Try and . The first leg is , the second leg is , and the hypotenuse is . The result is the triple . Notice that the generated legs can appear in either order: the formula may return the larger leg first or second, but is always the hypotenuse. The next section proves why these formulas always satisfy the Pythagorean theorem.
Mathematical Proof of Euclid's Formula
A short algebra proof shows why Euclid's formula can never fail.
Start with the two leg formulas, and , and test whether equals when . Substitute the formulas into the left side of the Pythagorean equation.
Expand both squares. The first square expands to and the second to , so the sum becomes the following expression.
Combine the middle terms: is . The expression is now a perfect square in disguise.
Factor it. The result is the square of , which is exactly .
Since , the right side is , and the proof is complete.
The key step is the middle terms cancelling partway: the from the first square and the from the second leave exactly the needed to complete the square. Because this works for any integers and with , every pair generates a genuine Pythagorean triple. The proof says nothing about primitiveness, though: whether the result is primitive depends on the extra conditions in the sections below.
What Is a Primitive Pythagorean Triple?
A primitive triple is a triple in its simplest form, with no shared factor.
A primitive Pythagorean triple is one whose three side lengths have no common positive integer factor greater than . In symbols, the greatest common divisor of the three sides is .
The triple is primitive because : no integer larger than divides all three numbers. The same holds for , , and . Each of these is a base triple that cannot be reduced to a smaller whole-number triple by division.
Primitive does not mean the triple is the smallest possible in every sense. It means only that the three values share no common factor other than . A large primitive triple such as is still primitive, because , , and have no common divisor. The table below compares the divisors of a primitive triple and a scaled copy.
| Triple | Common divisors | Primitive? |
|---|---|---|
| Yes | ||
| Yes | ||
| Yes | ||
| No | ||
| No |
What Is a Non-Primitive Pythagorean Triple?
A non-primitive triple is a scaled copy of a primitive one.
A non-primitive Pythagorean triple is a triple whose three values share a common integer factor greater than . It is still a valid triple, because it satisfies exactly. It is simply not in simplest form.
Start with the primitive triple and multiply every side by . The result is , and the check still works: . Multiply by instead and the result is , with . Both scaled triples are valid, and neither is primitive, because the first shares the factor and the second shares the factor .
Finding the common factor is simple: take the greatest common divisor of the three sides. For it is ; for it is . Dividing every side by that factor recovers the primitive triple underneath. So divided by returns , and divided by returns as well. Every non-primitive triple reduces to exactly one primitive triple this way.
Conditions for Generating Primitive Pythagorean Triples
Euclid's formula makes a primitive triple only when both parameter conditions hold.
Two conditions on and decide whether Euclid's formula produces a primitive triple. Both must hold at the same time, and neither alone is enough.
Condition 1: Coprime parameters
The parameters must be coprime, meaning they share no common factor greater than .
When and share a factor, that factor leaks into all three generated sides. For example, and share the factor , and the formula produces , whose sides all share the factor . The result is non-primitive.
Condition 2: Opposite parity
One parameter must be even and the other odd. When both parameters are odd, the generated legs and hypotenuse all come out even, so the triple shares the factor and cannot be primitive. For example, and are coprime but both odd, and the formula produces , which is the non-primitive triple with the legs in a different order.
Three parameter pairs show how the conditions work together. The pair is coprime with opposite parity and gives the primitive triple . The pair is coprime with opposite parity and gives the primitive triple . The pair is coprime but both odd, so it gives the non-primitive triple . Coprimality without opposite parity is not enough, and opposite parity without coprimality is not enough either.
Difference Between Primitive and Non-Primitive Triples
Same theorem, different form: one table sums up the whole distinction.
Both kinds of triple satisfy the Pythagorean theorem exactly, so both describe genuine right triangles. The difference is only about shared factors and how the triple was produced. A primitive triple is a base pattern; a non-primitive triple is usually a multiple of one.
| Feature | Primitive | Non-primitive |
|---|---|---|
| Common divisor | Only | Greater than |
| Side lengths | Cannot be reduced to a smaller integer triple | Can be divided by a common factor |
| Example | ||
| Generation | Coprime , with opposite parity | Other parameter combinations or integer multiples |
| Relationship | Base integer triple | Often a multiple of a primitive triple |
How to Generate More Triples by Scaling Existing Ones
Multiply every side by the same whole number and the triple stays valid.
For any positive integer , multiplying every side of a Pythagorean triple by gives another Pythagorean triple, .
The reason is simple algebra. Squaring the scaled legs gives , and factoring out gives . Since the original triple satisfies , the scaled sum equals , which is . The scaled triple therefore satisfies the theorem exactly.
Scaling by gives , and scaling by gives . Scaling by gives , and scaling by gives . Each result is a valid triple, and each is non-primitive, because the multiplier becomes a common factor of all three sides.
An integer multiplier preserves whole-number side lengths, which is why scaling is a reliable way to build new triples. An arbitrary real multiplier, such as , keeps the triangle a right triangle with the same shape, but the sides may stop being whole numbers: scaled by gives , which is a right triangle but not a Pythagorean triple. Note that the calculator itself has no separate multiplier field; scaling is a manual calculation you do with the triples it checks or generates.
Common Pythagorean Triple Examples
Ten triples worth knowing by heart, each one verified.
The table below lists ten well-known Pythagorean triples. Every row has been checked against the Pythagorean theorem, and every row is primitive except where a scaled multiple is noted. The legs in each row can be listed in either order: is the same triangle as .
| First leg | Second leg | Hypotenuse |
|---|---|---|
Step-by-Step Worked Examples Using the Calculator
Eight examples covering both modes: four checks and four generations.
Example 1: Check 3, 4, 5
Enter , , and in check mode. Square the legs and add: . Square the hypotenuse: . Since , the result is a valid triple. It is primitive, because , , and share no common factor.
Example 2: Check 5, 12, 13
Enter , , and . The legs give , and the hypotenuse gives . Since , the result is a valid triple. It is primitive, because .
Example 3: Check 6, 8, 10
Enter , , and . The legs give , and the hypotenuse gives . Since , the result is a valid triple. It is non-primitive, because all three sides share the factor ; dividing by returns the primitive triple .
Example 4: Check 7, 24, 25
Enter , , and . The legs give , and the hypotenuse gives . Since , the result is a valid triple. It is primitive, because , , and share no common factor.
Example 5: Generate using m = 2, n = 1
Enter and in generate mode. The first leg is , the second leg is , and the hypotenuse is . The result is , a primitive triple.
Example 6: Generate using m = 3, n = 2
Enter and . The first leg is , the second leg is , and the hypotenuse is . The result is , a primitive triple, because and are coprime with opposite parity.
Example 7: Generate using m = 4, n = 1
Enter and . The formulas give , , and . Listed with the legs in ascending order, the result is . It is primitive, because and are coprime with opposite parity.
Example 8: Generate using m = 3, n = 1
Enter and . The formulas give , , and . Listed with the legs in ascending order, the result is . This triple is non-primitive: and are coprime, but both are odd, so the opposite-parity condition fails and every side comes out even. Dividing by returns the primitive triple .
Why Are There Infinitely Many Pythagorean Triples?
Euclid's formula never runs out of inputs, so it never runs out of triples.
Euclid's formula accepts any pair of positive integers and with greater than , and there are infinitely many such pairs. Each new pair produces a triple, and different pairs generally produce different triples. The pairs , , , , and give , , , , and respectively, and the list keeps going: gives , and gives . Larger values of keep producing larger triples without end.
Integer multiples add even more. Every primitive triple generates a whole family of scaled copies: alone gives , , , and so on forever. Between the endless parameter pairs and the endless multiples, the supply of Pythagorean triples is infinite. Note the careful wording: not every parameter pair produces a primitive triple, but every pair produces a valid triple, and the primitive ones are infinite too.
How to Recognize a Pythagorean Triple Without Guessing
A few habits make familiar triples jump out before you calculate.
Start by treating the largest value as the hypotenuse and comparing the squared values, exactly as the checking steps describe. With practice, the common triples become familiar: --, --, --, and -- appear so often in textbooks and exams that recognizing them saves real time.
Look for common factors next. If all three numbers are even, divide by and see what remains. The set -- is instantly recognizable as twice -- once the factor is spotted. Reducing a non-primitive triple to its primitive form often reveals a familiar pattern hiding behind larger numbers.
When you need a new triple rather than a check, Euclid's formula is the reliable route: pick small values of and and generate. Recognition is a helpful shortcut, but exact verification is always the final word. A triple that looks familiar still deserves the square-and-compare test before you rely on it.
Pythagorean Triples and Ordinary Right Triangles
Every triple is a right triangle, but most right triangles are not triples.
A right triangle can have integer side lengths, decimal side lengths, or irrational side lengths. Only the first category can form a Pythagorean triple. The triple is an integer right triangle, and it qualifies. A triangle with legs and and hypotenuse is a genuine right triangle, since , but its hypotenuse is irrational, so it is not a triple. A triangle with sides , , and fails the equation, since and , so it is not even a right triangle.
The distinction matters in practice. Builders use -- because whole numbers are easy to measure with a tape. A triangle with sides , , and looks almost right but is off by a visible angle, and no whole-number check would pass it. The Pythagorean theorem applies to all right triangles, whatever their side lengths. The term Pythagorean triple refers only to the positive integer solutions, and that narrow meaning is what makes triples special.
Common Mistakes When Using the Pythagorean Triples Calculator
Fifteen mistakes, each with the fix beside it.
- Entering as a smaller side: the hypotenuse must be the largest value, so always assign the biggest number to before checking.
- Forgetting to square the values: the theorem compares squares, not the side lengths themselves, so square , , and first.
- Adding the sides instead of their squares: is the wrong sum; the check needs against .
- Using instead of : the plain sum of two sides never equals the hypotenuse in a right triangle.
- Confusing the hypotenuse with a leg: the hypotenuse sits opposite the right angle and is always the longest side.
- Using decimal values and expecting an integer triple: decimals can form a right triangle, but only positive integers form a Pythagorean triple.
- Entering zero or negative side lengths: side lengths must be positive, and zero or negative inputs are rejected.
- Using equal to : the first leg becomes , which is not a triangle side.
- Using smaller than : the first leg becomes negative, which is impossible for a side length.
- Entering decimal and values: Euclid's formula needs positive integer parameters to produce integer sides.
- Assuming every generated triple is primitive: generation only guarantees a valid triple, and primitiveness needs coprime parameters with opposite parity.
- Assuming all primitive triples are multiples of --: -- and -- are independent primitive triples, not multiples of --.
- Forgetting the opposite-parity condition: two odd parameters produce an even, non-primitive triple, as , shows.
- Forgetting to check common factors: a triple such as looks new until the shared factor reveals it as a scaled .
- Confusing a valid right triangle with an integer Pythagorean triple: a triangle with irrational or decimal sides can satisfy the theorem without being a triple.
Practice Problems With Answers
Eight problems, four checks and four generations, with full solutions.
- Check whether , , and form a triple. Answer: yes, primitive. , and the three numbers share no common factor.
- Check whether , , and form a triple. Answer: no. , but , so the two sides differ.
- Identify whether , , and are primitive. Answer: non-primitive. The numbers share the factor , and dividing by gives the primitive triple .
- Generate a triple using and . Answer: . , , .
- Generate a triple using and . Answer: . , , .
- Generate a triple using and . Answer: . , , , with the legs sorted ascending.
- Identify whether and produce a primitive triple. Answer: no. The parameters are coprime but both odd, so the result is the non-primitive triple .
- Find the common multiplier between -- and --. Answer: . Each side of multiplied by gives .
Frequently Asked Questions
Answers to the most common right-triangle solving questions.
01 What is a Pythagorean triple?
A Pythagorean triple is a set of three positive whole numbers, written , that satisfy the equation . The two smaller numbers are the legs of a right triangle and the largest is the hypotenuse. The best-known example is , since .
02 How does the Pythagorean Triples Calculator work?
It has two modes. Check mode takes three whole numbers and tests whether holds. Generate mode takes two integers, and , and applies Euclid's formula to build a new triple. Both modes show step-by-step working with the result.
03 How can I check whether three numbers form a Pythagorean triple?
Take the largest value as the hypotenuse and the other two as the legs and . Square all three, add , and compare with . Equal totals mean a valid triple; unequal totals mean the numbers do not form one.
04 What is Euclid's formula?
Euclid's formula generates a Pythagorean triple from two positive integers, and , with greater than . The formulas are , , and . Every pair produces a valid triple, as the algebra proof on this page shows.
05 What are m and n in the Pythagorean triple formula?
The values and are positive integer parameters in Euclid's formula. The value is the larger integer and is the smaller one, with . Larger values of produce larger triples, and different pairs produce different triples.
06 What is a primitive Pythagorean triple?
A primitive triple is one whose three side lengths share no common factor greater than , so . Examples include , , , and . Primitive triples cannot be reduced to a smaller whole-number triple.
07 What is a non-primitive Pythagorean triple?
A non-primitive triple is a valid triple whose three sides share a common factor greater than . For example, is twice and is three times . Dividing by the common factor returns the primitive triple underneath.
08 How do I know if a generated triple is primitive?
Check the two parameter conditions: and must be coprime, so , and they must have opposite parity, so one is even and the other is odd. If both conditions hold, the generated triple is primitive. If either fails, it is non-primitive.
09 Can decimal numbers form a Pythagorean triple?
No. A Pythagorean triple is defined as three positive integers, so decimal side lengths never qualify. Decimals can still form a right triangle that satisfies , such as legs and with hypotenuse , but that triangle is not a Pythagorean triple.
10 Are there infinitely many Pythagorean triples?
Yes. Euclid's formula accepts infinitely many integer pairs , and each pair produces a triple. Integer multiples add more: every primitive triple generates an endless family of scaled copies. The supply of triples never runs out.
11 Can every Pythagorean triple be generated using Euclid's formula?
Yes, every primitive triple comes from Euclid's formula with suitable coprime parameters of opposite parity, and every non-primitive triple is a multiple of a primitive one. So every Pythagorean triple can be reached through Euclid's formula plus scaling by a positive integer.
12 What is the most common Pythagorean triple?
The triple is the most common and best known. It is the smallest primitive triple, it is easy to remember, and builders and carpenters have used it for centuries to check square corners. The next most familiar are and .