Pythagorean Triple Calculator Tool
Pythagorean Triple Suite
What Is a Pythagorean Triple?
A Pythagorean triple is a set of three positive integers (a, b, c) that satisfy the Pythagorean equation:
a² + b² = c²
In this relationship, a and b represent the integer lengths of the perpendicular legs of a right triangle, while c represents the integer length of the hypotenuse (the longest side opposite the right angle).
Classic examples of Pythagorean triples include:
- (3, 4, 5): 3² + 4² = 9 + 16 = 25 = 5²
- (5, 12, 13): 5² + 12² = 25 + 144 = 169 = 13²
- (7, 24, 25): 7² + 24² = 49 + 576 = 625 = 25²
- (8, 15, 17): 8² + 15² = 64 + 225 = 289 = 17²
Crucially, a Pythagorean triple requires all three side lengths to be exact positive integers. Non-integer right triangle side combinations (such as 1, 1, √2) satisfy the general Pythagorean theorem but are not Pythagorean triples.
Pythagorean Triple Formula
The defining mathematical formula for integer triples is derived directly from right-triangle geometry:
a² + b² = c² (where a, b, c are positive integers 1, 2, 3...)
Where:
- a: First integer leg length (perpendicular side)
- b: Second integer leg length (base side)
- c: Integer hypotenuse length (longest side, where c > a and c > b)
- Positive Integers: Whole numbers without decimals or fractions
This formula enforces two simultaneous constraints: geometric right-angle alignment and exact integer closure.
How the Pythagorean Triple Calculator Works
The Pythagorean Triple Calculator provides four specialized computational modes to work with integer triples:
1. Check Triple Mode
Takes three positive integers a, b, and c, sorts them so that the largest value is candidate hypotenuse c, evaluates a² + b² versus c², and determines primitive status via gcd(a,b,c).
2. Find Third Side Mode
Solves for an unknown hypotenuse or missing leg from two known integers. It verifies whether the resulting side is a positive integer before classifying the set as a true Pythagorean triple.
3. Generate Triples Mode
Iterates systematically up to a specified maximum hypotenuse c, finding all unique canonical triples (where a < b < c) and allowing filtering by primitive status.
4. Euclid's Formula Mode
Uses parameters m > n > 0 to construct exact triples via a = m² - n², b = 2mn, and c = m² + n², giving step-by-step mathematical proofs.
How to Check Whether Three Numbers Form a Pythagorean Triple
Follow this 5-step procedure to determine if three given numbers form a valid Pythagorean triple:
- Verify Integer Status: Ensure that all three numbers a, b, and c are positive whole numbers (1, 2, 3...) in Euclidean geometry. If any value is a decimal or fraction, it is not a Pythagorean triple.
- Identify the Largest Value: Assign the largest number to candidate hypotenuse c. Assign the remaining two smaller values to legs a and b.
- Square the Legs: Calculate a² and b², then sum them: a² + b².
- Square the Candidate Hypotenuse: Calculate c².
- Compare Sums: If a² + b² = c², the three numbers form a valid Pythagorean triple.
Worked Checking Example: (5, 12, 13)
1. Values are integers: 5, 12, 13 ✓
2. Largest value is c = 13; legs are a = 5, b = 12.
3. Sum of squared legs: 5² + 12² = 25 + 144 = 169.
4. Hypotenuse squared: 13² = 169.
5. Comparison: 169 = 169 ✓ (5-12-13 is a valid Pythagorean triple).
Common Pythagorean Triples
Pythagorean triples are integer side combinations that satisfy right-triangle geometry (a² + b² = c²). Below are the four most famous primitive parent triples, followed by an interactive reference list up to hypotenuse c = 100:
Interactive Pythagorean Triple Reference Table
Filter by primitive or scaled status, or click Test on any row to load the triple into the calculator:
| Leg a | Leg b | Hypotenuse c | Primitive? | GCD Factor / Family | Action |
|---|---|---|---|---|---|
| 3 | 4 | 5 | ✓ Yes | Fundamental Base (3-4-5) | |
| 5 | 12 | 13 | ✓ Yes | Fundamental Base (5-12-13) | |
| 6 | 8 | 10 | ⚡ Scaled | 2 × (3-4-5) | |
| 7 | 24 | 25 | ✓ Yes | Fundamental Base (7-24-25) | |
| 8 | 15 | 17 | ✓ Yes | Fundamental Base (8-15-17) | |
| 9 | 12 | 15 | ⚡ Scaled | 3 × (3-4-5) | |
| 9 | 40 | 41 | ✓ Yes | Fundamental Base (9-40-41) | |
| 10 | 24 | 26 | ⚡ Scaled | 2 × (5-12-13) | |
| 12 | 16 | 20 | ⚡ Scaled | 4 × (3-4-5) | |
| 12 | 35 | 37 | ✓ Yes | Fundamental Base (12-35-37) | |
| 15 | 20 | 25 | ⚡ Scaled | 5 × (3-4-5) | |
| 16 | 30 | 34 | ⚡ Scaled | 2 × (8-15-17) | |
| 20 | 21 | 29 | ✓ Yes | Fundamental Base (20-21-29) | |
| 28 | 45 | 53 | ✓ Yes | Fundamental Base (28-45-53) | |
| 33 | 56 | 65 | ✓ Yes | Fundamental Base (33-56-65) | |
| 36 | 77 | 85 | ✓ Yes | Fundamental Base (36-77-85) | |
| 39 | 80 | 89 | ✓ Yes | Fundamental Base (39-80-89) | |
| 48 | 55 | 73 | ✓ Yes | Fundamental Base (48-55-73) | |
| 65 | 72 | 97 | ✓ Yes | Fundamental Base (65-72-97) |
Primitive Pythagorean Triples
A primitive Pythagorean triple is a triple (a, b, c) where the three side lengths share no common factor greater than 1. Formally, their greatest common divisor is 1:
gcd(a, b, c) = 1
Key properties of primitive Pythagorean triples:
- Exactly one leg (a or b) is even, and the other leg is odd.
- The hypotenuse c is always an odd integer.
- Primitive triples form the core building blocks from which all non-primitive triples are generated by integer scaling.
- Examples: (3, 4, 5), (5, 12, 13), (7, 24, 25), (8, 15, 17), (9, 40, 41).
Non-Primitive Pythagorean Triples
A non-primitive Pythagorean triple is an integer triple (a, b, c) whose side lengths share a common divisor k > 1. Formally:
gcd(a, b, c) = k > 1
Every non-primitive triple can be simplified by dividing each side by k, resulting in its underlying primitive parent triple (a/k, b/k, c/k).
Examples of non-primitive triples derived from (3, 4, 5):
- (6, 8, 10): 2 × (3, 4, 5) — common factor k = 2.
- (9, 12, 15): 3 × (3, 4, 5) — common factor k = 3.
- (12, 16, 20): 4 × (3, 4, 5) — common factor k = 4.
- (15, 20, 25): 5 × (3, 4, 5) — common factor k = 5.
Primitive vs. Non-Primitive Pythagorean Triples
The following table summarizes the structural differences between primitive and non-primitive triples:
| Feature / Property | Primitive Triple gcd = 1 | Non-Primitive Triple gcd > 1 |
|---|---|---|
| GCD Condition | gcd(a,b,c) = 1 | gcd(a,b,c) = k > 1 |
| Leg Parity | One leg odd, one leg even | Can be both even (or mixed) |
| Hypotenuse Parity | Always odd integer | Can be even or odd depending on scaling factor k |
| Derivation | Generated by Euclid's parameters (m, n) |
Generated by integer scaling k × (a, b, c) |
| Examples | (3, 4, 5), (5, 12, 13), (8, 15, 17) | (6, 8, 10), (10, 24, 26), (16, 30, 34) |
How to Generate Pythagorean Triples
The primary mathematical method for generating Pythagorean triples is Euclid's formula. Given any two arbitrary positive integers m and n with m > n > 0, Euclid's formula computes a valid triple (a, b, c) using:
a = m² - n²
b = 2mn
c = m² + n²
Proof of Euclid's Formula Validity
Substituting Euclid's side expressions into a² + b²:
a² + b² = (m² - n²)² + (2mn)²
a² + b² = (m⁴ - 2m²n² + n⁴) + 4m²n² = m⁴ + 2m²n² + n⁴
c² = (m² + n²)² = m⁴ + 2m²n² + n⁴
Since a² + b² = c², the formula guarantees a valid right triangle for any choice of m > n > 0.
Generating Primitive Pythagorean Triples
To ensure that Euclid's formula generates a primitive Pythagorean triple (where gcd(a,b,c) = 1), the parameters m and n must satisfy three exact conditions:
- Strict Inequality: m > n > 0
- Coprimality: gcd(m, n) = 1 (m and n share no common prime factors)
- Opposite Parity: One parameter is even, and the other is odd (meaning m - n is odd).
If m and n are both odd, or if gcd(m,n) > 1, Euclid's formula produces a non-primitive triple that can be scaled down by a factor of 2 or gcd(m,n)².
| m | n | m & n Parameter Conditions | a = m² - n² | b = 2mn | c = m² + n² | Generated Triple |
|---|---|---|---|---|---|---|
| 2 | 1 | gcd(2,1)=1, 2 even / 1 odd | 3 | 4 | 5 | (3, 4, 5) |
| 3 | 2 | gcd(3,2)=1, 3 odd / 2 even | 5 | 12 | 13 | (5, 12, 13) |
| 4 | 1 | gcd(4,1)=1, 4 even / 1 odd | 15 | 8 | 17 | (8, 15, 17) |
| 4 | 3 | gcd(4,3)=1, 4 even / 3 odd | 7 | 24 | 25 | (7, 24, 25) |
| 5 | 2 | gcd(5,2)=1, 5 odd / 2 even | 21 | 20 | 29 | (20, 21, 29) |
Scaling a Pythagorean Triple
If (a, b, c) is a valid Pythagorean triple, then multiplying all three numbers by any positive integer scaling factor k produces a new valid Pythagorean triple:
(a, b, c) → (k × a, k × b, k × c) (for integer k ≥ 1)
Proof by substitution:
(k × a)² + (k × b)² = k²a² + k²b² = k²(a² + b²) = k²c² = (k × c)²
When k = 1, the triple retains its primitive status. When k > 1, the resulting triple is non-primitive with a common divisor of k.
Pythagorean Triple Multiples
Scaling primitive triples creates infinite "families" or series of integer multiples. Below is the 3-4-5 family scaled up to multiplier k = 10:
| Multiplier (k) | Leg ka | Leg kb | Hypotenuse kc | Scaled Triple |
|---|---|---|---|---|
| k = 1 | 3 | 4 | 5 | (3, 4, 5) — Primitive Base |
| k = 2 | 6 | 8 | 10 | (6, 8, 10) |
| k = 3 | 9 | 12 | 15 | (9, 12, 15) |
| k = 4 | 12 | 16 | 20 | (12, 16, 20) |
| k = 5 | 15 | 20 | 25 | (15, 20, 25) |
| k = 6 | 18 | 24 | 30 | (18, 24, 30) |
| k = 7 | 21 | 28 | 35 | (21, 28, 35) |
| k = 8 | 24 | 32 | 40 | (24, 32, 40) |
| k = 9 | 27 | 36 | 45 | (27, 36, 45) |
| k = 10 | 30 | 40 | 50 | (30, 40, 50) |
Pythagorean Triple With a Given Hypotenuse
A given integer hypotenuse c may correspond to zero, one, or multiple distinct Pythagorean triples, depending on its prime factorization:
- Hypotenuse c = 5: Exactly 1 triple → (3, 4, 5)
- Hypotenuse c = 13: Exactly 1 triple → (5, 12, 13)
- Hypotenuse c = 25: Exactly 2 triples → Primitive (7, 24, 25) and Non-primitive (15, 20, 25)
- Hypotenuse c = 65: Exactly 4 triples → Primitive (33, 56, 65), (16, 63, 65), and Non-primitive (39, 52, 65), (25, 60, 65)
According to Fermat's theorem on sums of two squares, the number of primitive triples with hypotenuse c depends on the number of distinct prime factors of c of the form 4k + 1.
Pythagorean Triples With a Given Leg
Every odd integer leg length a = 2k + 1 (for k ≥ 1) forms a primitive triple using:
b = (a² - 1) / 2 and c = (a² + 1) / 2
Examples of multiple triples containing the same leg length:
- Leg length 15: Belongs to (9, 12, 15), (15, 20, 25), (15, 36, 39), and (15, 112, 113).
- Leg length 24: Belongs to (7, 24, 25), (10, 24, 26), (18, 24, 30), (24, 32, 40), (24, 45, 51), (24, 70, 74), and (24, 143, 145).
Are All Right Triangles Pythagorean Triples?
No. While every right triangle satisfies the geometric relation a² + b² = c², only right triangles with three positive integer side lengths form Pythagorean triples.
Classic Counter-Example: Isosceles Right Triangle (1, 1, √2)
Consider a right triangle with legs a = 1 and b = 1:
c = √(1² + 1²) = √2 ≈ 1.41421356...
This forms a valid right triangle, but because √2 is an irrational number and not an integer, (1, 1, √2) is NOT a Pythagorean triple.
Pythagorean Triple vs. Pythagorean Theorem
Although closely connected, the Pythagorean theorem and Pythagorean triples represent distinct concepts in geometry and number theory:
| Concept Dimension | Pythagorean Theorem (a² + b² = c²) |
Pythagorean Triple Integers Only |
|---|---|---|
| Definition | Universal geometric relation for right-angled triangles | Specific set of three positive integers satisfying a² + b² = c² |
| Allowed Domain | All real positive numbers (continuous) | Positive integers only (1, 2, 3...) |
| Side Length Types | Includes decimals, radicals (e.g. √5), and irrational numbers |
Strictly whole integers without fractions or square root radicals |
| Primary Application | Distance calculation, trigonometry, physics, continuous geometry | Number theory, discrete math, construction layout grid benchmarks |
For general right-triangle calculations involving decimals or irrational side lengths, visit our primary Pythagorean Theorem Calculator.
Pythagorean Triple Calculator vs. Pythagorean Triple Checker
Understanding the operational difference between calculator and checker tools:
Pythagorean Triple Calculator
Designed to calculate missing sides, generate lists of triples, compute parameters via Euclid's formula, and scale triples across multiplier series.
Pythagorean Triple Checker
Designed specifically to take three user-supplied values, sort them, evaluate squared equality, compute squared differences, and test whether they form a valid right triangle.
Launch Triple Checker →Pythagorean Triple vs. Standard Pythagorean Calculator
A standard Pythagorean Calculator solves for side c given any arbitrary legs a and b (e.g. a = 3.5, b = 4.2 → c ≈ 5.467). In contrast, this Pythagorean Triple Calculator restricts solutions strictly to positive integer side combinations and evaluates primitive GCD factors.
Pythagorean Triple Calculation Examples
Here are five detailed mathematical examples demonstrating triple checking, side solving, scaling, and Euclid generation:
Example 1 — Verification of 3-4-5
Input: a = 3, b = 4, c = 5
Step 1: Calculate a² + b² = 3² + 4² = 9 + 16 = 25.
Step 2: Calculate c² = 5² = 25.
Step 3: 25 = 25 ✓ (Valid Triple).
Step 4: Check GCD: gcd(3, 4, 5) = 1 → Primitive Pythagorean Triple studied by Pythagoras.
Example 2 — Verification of 5-12-13
Input: a = 5, b = 12, c = 13
Step 1: Calculate a² + b² = 5² + 12² = 25 + 144 = 169.
Step 2: Calculate c² = 13² = 169.
Step 3: 169 = 169 ✓ (Valid Triple).
Step 4: Check GCD: gcd(5, 12, 13) = 1 → Primitive Pythagorean Triple.
Example 3 — Verification of 8-15-17
Input: a = 8, b = 15, c = 17
Step 1: Calculate a² + b² = 8² + 15² = 64 + 225 = 289.
Step 2: Calculate c² = 17² = 289.
Step 3: 289 = 289 ✓ (Valid Triple).
Step 4: Check GCD: gcd(8, 15, 17) = 1 → Primitive Pythagorean Triple.
Example 4 — Scaling (3, 4, 5) by Multiplier k = 4
Base Triple: (3, 4, 5)
Multiplier: k = 4
Calculation: a = 3 × 4 = 12, b = 4 × 4 = 16, c = 5 × 4 = 20.
Verification: 12² + 16² = 144 + 256 = 400 = 20².
Result: (12, 16, 20) is a valid non-primitive triple with gcd(12, 16, 20) = 4.
Example 5 — Euclid's Formula Generation (m = 3, n = 2)
Given Parameters: m = 3, n = 2 (m > n > 0, gcd(3,2) = 1, 3 odd / 2 even)
Calculate a: a = m² - n² = 3² - 2² = 9 - 4 = 5.
Calculate b: b = 2mn = 2 × 3 × 2 = 12.
Calculate c: c = m² + n² = 3² + 2² = 9 + 4 = 13.
Result: Yields the fundamental primitive triple (5, 12, 13).
Pythagorean Triple Input Requirements
To ensure mathematical validity and accurate calculator output, enforce these input rules:
- Checking Mode: Require three positive integer inputs (a, b, c). Zero, negative numbers, or decimal values are invalid.
- Side Solver Mode: Require positive integer inputs. Known legs must be smaller than the hypotenuse (c > a and c > b).
- Generator Mode: Search limit maximum hypotenuse must be a positive integer c ≥ 5.
- Euclid Mode: Require parameters m and n satisfying m > n > 0 with integer inputs.
Pythagorean Triple Accuracy and Integer Handling
Integer accuracy is essential when working with Pythagorean triples. Floating-point arithmetic in computers can introduce subtle rounding inaccuracies (e.g. 4.999999999999999 instead of 5).
Our calculator uses exact BigInt and integer-check algorithms (Number.isInteger()) to guarantee that non-integers are never misclassified as Pythagorean triples. Approximate tolerances are strictly avoided so that values like 3, 4, 5.0000001 are correctly flagged as non-triples.
Common Pythagorean Triple Mistakes
Avoid these 12 common misconceptions when studying or working with Pythagorean triples:
- Assuming every right triangle is a Pythagorean triple: Forgetting that all three side lengths must be integers.
- Treating decimal or radical solutions as triples: Classifying (1, 1, √2) or (3, 4, 5.1) as triples.
- Failing to identify the largest value as hypotenuse c: Testing 3² + 5² = 4² instead of 3² + 4² = 5².
- Checking raw addition instead of squared sums: Mistakenly checking a + b = c (3 + 4 = 7 ≠ 5) instead of a² + b² = c².
- Forgetting to square values: Adding raw side lengths before extracting square roots.
- Mistaking non-primitive triples for primitive ones: Labelling (6, 8, 10) as primitive despite gcd(6,8,10) = 2.
- Assuming each hypotenuse has only one unique triple: Overlooking that c = 25 is shared by (7, 24, 25) and (15, 20, 25).
- Ignoring scaled multiples: Failing to realize that multiplying a primitive triple yields a new valid triple.
- Using invalid parameters in Euclid's formula: Entering n ≥ m or negative parameters.
- Expecting non-primitive output from Euclid's coprimality rules: Forgetting that gcd(m,n) = 1 and opposite parity generate primitive triples.
- Rounding intermediate values prematurely: Using floating-point approximations prior to testing integer equality.
- Generating duplicate permutations: Treating (3, 4, 5) and (4, 3, 5) as separate distinct triples instead of using canonical a < b < c order.
Pythagorean Triples in Mathematics and Geometry
Pythagorean triples hold a central place across mathematics, geometry, and computer science:
- Number Theory & Diophantine Equations: Triples represent non-trivial integer solutions to the Diophantine equation x² + y² = z². Fermat's Last Theorem expanded on this by proving that xⁿ + yⁿ = zⁿ has no integer solutions for n > 2.
- Trigonometry & Exact Ratios: Triples provide exact rational values for sine, cosine, and tangent angles without radical signs (e.g. sin(θ) = 3/5, cos(θ) = 4/5).
- Computer Graphics & Integer Rasterization: Triples enable exact integer grid calculations for vector rotation and 2D rendering without floating-point drift.
Pythagorean Triples and Integer Coordinates
Pythagorean triples describe right triangles whose vertices land precisely on integer Cartesian grid coordinates (x, y):
Grid Example: 3-4-5 Triangle
Place vertices at points A(0,0), B(3,0), and C(0,4):
Distance AB = |3 - 0| = 3
Distance AC = |4 - 0| = 4
Distance BC = √((3 - 0)² + (0 - 4)²) = √(9 + 16) = √25 = 5
All three vertices lie on exact lattice points with integer distances between them.
Pythagorean Triple Calculator FAQ
A Pythagorean triple consists of three positive integers (a, b, c) that satisfy the equation a² + b² = c², where c is the hypotenuse of a right triangle.
The 3-4-5 triple is the smallest and most famous primitive Pythagorean triple (3² + 4² = 9 + 16 = 25 = 5²).
Identify the largest number as c, square all three numbers, add a² + b², and check whether a² + b² equals c² with all three values being positive integers.
A Pythagorean triple is primitive when the greatest common divisor (GCD) of a, b, and c is 1 (gcd(a,b,c) = 1), meaning they share no common integer factor greater than 1.
A non-primitive triple is an integer multiple of a primitive triple (gcd > 1), such as 6-8-10, which is 2 × (3-4-5).
Triples are generated using Euclid's formula: a = m² - n², b = 2mn, c = m² + n² for positive integers m > n > 0.
Euclid's formula generates Pythagorean triples from two integers m and n (m > n > 0) using a = m² - n², b = 2mn, and c = m² + n².
Yes. Multiplying any triple (a,b,c) by a positive integer factor k yields a new valid triple (ka, kb, kc).
No. All right triangles satisfy a² + b² = c², but only right triangles with three positive integer side lengths form Pythagorean triples.
Yes. For example, hypotenuse c = 25 is shared by both primitive triple (7, 24, 25) and non-primitive triple (15, 20, 25).
Yes. Leg length 15 belongs to triples (9, 12, 15), (15, 20, 25), (15, 36, 39), and (15, 112, 113).
A calculator generates, finds, and scales integer triples, whereas a checker verifies whether three specific supplied numbers satisfy a² + b² = c².
Related Pythagorean Calculators
Explore other specialized calculators across our geometry and trigonometry collection:
Pythagorean Theorem Calculator
Solve any right triangle side length using the core a² + b² = c² formula.
Main Calculator →3D Pythagorean Calculator
Calculate 3D space diagonal distances (d = √(x² + y² + z²)).
3D Calculator →Construction Calculator
Job site layout tool for checking diagonals and scaling 3-4-5 corners.
Construction Tool →Isosceles Right Triangle
Special 45°-45°-90° triangle solver (legs equal, c = a√2).
Isosceles Tool →