Pythagorean Triples Calculator
Test cases replayed : 3 of 3 match · Methodology · No outside source listed
Enter two whole numbers m > n > 0 to build a triple, and three whole numbers to test whether a² + b² = c².
Result
Triple: c = m² + n²
Triple: a = m² − n²
- Triple: b = 2mn
- Primitive (no common factor)?
- Is (a, b, c) of the check a triple?
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- m (whole number, larger than n): enter 1 or more.
- n (whole number, at least 1): enter 1 or more.
- Check: side a: enter 0 or more.
- Check: side b: enter 0 or more.
- Check: longest side c: enter 0 or more.
- Read the result: Triple: c = m² + n²; the panel also shows Triple: a = m² − n², Triple: b = 2mn, Primitive (no common factor)? and Is (a, b, c) of the check a triple?.
How this calculator works
A Pythagorean triple is three positive whole numbers with a² + b² = c², the side lengths of a right triangle. Euclid's formula (Elements, Book X) builds one from any whole numbers m > n > 0: a = m² − n², b = 2mn, c = m² + n².
The triple is primitive when a, b and c share no common factor; this happens exactly when m and n have no common factor and are not both odd. Every primitive triple comes from one such pair, and every other triple is a multiple of a primitive one.
The formula
| Symbol | Meaning |
|---|---|
| m (whole number, larger than n) | |
| n (whole number, at least 1) | |
| Triple: c = m² + n² |
Worked example
| m (whole number, larger than n) | 2 |
|---|---|
| n (whole number, at least 1) | 1 |
| Check: side a | 5 |
| Check: side b | 12 |
| Check: longest side c | 13 |
| Triple: a = m² − n² | 3 |
|---|---|
| Triple: b = 2mn | 4 |
| Primitive (no common factor)? | Yes (primitive) |
| Is (a, b, c) of the check a triple? | Yes, a Pythagorean triple |
Triple: c = m² + n² 5
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
What are the first Pythagorean triples?
(3, 4, 5) from m = 2, n = 1; (5, 12, 13) from m = 3, n = 2; (8, 15, 17) from m = 4, n = 1; (7, 24, 25) from m = 4, n = 3.
Is (6, 8, 10) a Pythagorean triple?
Yes, 36 + 64 = 100, but it is not primitive: it is 2 × (3, 4, 5).