Skip to content
FiftyCalc Free calculators for all 50 states

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

Sample figures

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.

Pythagorean Triples Calculator

m (whole number, larger than n): enter 1 or more. Prefilled example: 2.

n (whole number, at least 1): enter 1 or more. Prefilled example: 1.

Check: side a: enter 0 or more. Prefilled example: 5.

Check: side b: enter 0 or more. Prefilled example: 12.

Check: longest side c: enter 0 or more. Prefilled example: 13.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. m (whole number, larger than n): enter 1 or more.
  2. n (whole number, at least 1): enter 1 or more.
  3. Check: side a: enter 0 or more.
  4. Check: side b: enter 0 or more.
  5. Check: longest side c: enter 0 or more.
  6. 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

  1. Tc=m2+n2
Symbols used in the formula
SymbolMeaning
mm (whole number, larger than n)
nn (whole number, at least 1)
TcTriple: c = m² + n²

Worked example

m (whole number, larger than n)2
n (whole number, at least 1)1
Check: side a5
Check: side b12
Check: longest side c13
Triple: a = m² − n²3
Triple: b = 2mn4
Primitive (no common factor)?Yes (primitive)
Is (a, b, c) of the check a triple?Yes, a Pythagorean triple
  1. Tc=22+12=5

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).

Related calculators