A Pythagorean triple is a set of three whole numbers a, b and c with a² + b² = c². The Pythagorean triples calculator builds a triple with Euclid’s formula and gives the two legs, the hypotenuse, the perimeter, the area and a check that says whether the triple is primitive.
How the calculation works
- Enter two whole numbers m and n with m greater than n. They are the two parameters of Euclid’s formula.
- Enter the scale factor k. With k = 1 you get the basic triple, and a larger k multiplies the three sides by the same whole number.
- The calculator gives the legs a = k (m² − n²) and b = k × 2mn, and the hypotenuse c = k (m² + n²).
- It also gives the perimeter, the area of the right triangle and a flag that says whether the triple is primitive. A triple is primitive when m and n have no common factor, when one of them is even and the other odd, and when k = 1.
Example
Take m = 5, n = 2 and k = 1. The first leg is 5² − 2² = 25 − 4 = 21, the second leg is 2 × 5 × 2 = 20 and the hypotenuse is 25 + 4 = 29. Check: 21² + 20² = 441 + 400 = 841 = 29². The perimeter is 21 + 20 + 29 = 70 and the area is 21 × 20 / 2 = 210. The numbers 5 and 2 have no common factor and 5 − 2 = 3 is odd, so the triple is primitive.
Why it matters
The calculator helps students, teachers and puzzle makers to find right triangles with whole-number sides, to prepare exercises with clean answers and to check a triple quickly. Carpenters and masons also use triples such as 3-4-5, 5-12-13 and 8-15-17 to set a right angle on a site without a square, and a larger k gives the same angle over a longer span.
Good to know
Euclid’s formula gives each primitive triple once, but the legs may come out in either order, since the one with m² − n² is not always the shorter one. Use a scale factor of 1 to list the primitive triples, and then multiply to get the others. For field layout, measure the three sides with the same tape and check the diagonal. A small error on a short side shows up clearly on the diagonal.
Related tools
The Pythagorean theorem calculator finds a missing side from the other two, the special right triangles calculator covers the 45-45-90 and 30-60-90 shapes, the triangle solver handles any triangle, and the polygonal numbers calculator explores another family of whole-number patterns.