Pythagorean Triples Generator — Primitive & Scaled Triples

Generate integer triples \((a,b,c)\) with \(a^2 + b^2 = c^2\). Private by design — runs locally in your browser.

Controls & Diagram

Euclid: a=m²−n², b=2mn, c=m²+n²

Triples

abcprimitive?a:bperimeter

Tip: Click any row to preview it in the diagram.

About Pythagorean Triples (with Quick Visuals)

A Pythagorean triple is a set of positive integers \((a,b,c)\) satisfying \(a^2+b^2=c^2\). These numbers measure the sides of a right triangle, with \(c\) as the hypotenuse. The classic example is \((3,4,5)\), since \(3^2+4^2=9+16=25=5^2\). Triples come in two flavors: primitive (no common factor: \(\gcd(a,b,c)=1\)) and non-primitive (multiples of a primitive triple). For instance, \((6,8,10)\) is a non-primitive multiple of \((3,4,5)\).

All primitive triples can be produced by Euclid’s formula. Choose integers \(m>n\) with \(\gcd(m,n)=1\) and exactly one of \(m,n\) even, then \[ a=m^2-n^2,\quad b=2mn,\quad c=m^2+n^2. \] Every primitive triple appears exactly once this way. Multiplying by a positive integer \(k\) yields every non-primitive triple \( (ka, kb, kc)\).

In this generator, set a max hypotenuse to constrain size. Turn on “Primitive only” to explore the fundamental families, or include multiples to see all triples up to your bound. You can also search for triples containing a specific leg (e.g., all triples with \(a=20\)) or a specific hypotenuse (e.g., \(c=65\)). The table can be sorted by \(a\), \(b\), \(c\), perimeter, or aspect ratio \(a{:}b\), and you can export the results to CSV for class handouts or further analysis. Everything runs locally in your browser—no uploads—so it’s fast and private.

5 Fun Facts about Pythagorean Triples

Infinite recipe

Euclid’s formula with \(m>n\), opposite parity, and \(\gcd(m,n)=1\) spits out every primitive triple—proof there are infinitely many right triangles with all-integer sides.

Guarantee

Only one in a row

\((3,4,5)\) is the lone triple of three consecutive integers. Any other triple must skip a number—an easy way to spot impostors.

Consecutive rarity

Every odd joins the club

Pick any odd \(k>1\); \((k,\tfrac{k^2-1}{2},\tfrac{k^2+1}{2})\) is a valid triple. Example: \(k=99\) yields \((99,4900,4901)\).

Instant leg builder

Area loves 6

Every primitive triple’s area is divisible by 6. One leg is a multiple of 4, one is a multiple of 3, so \(A=\tfrac{ab}{2}\) always keeps a factor of 3.

Sanity check

Circle connection

Primitive triples correspond to reduced rational points on the unit circle via \((\tfrac{m^2-n^2}{m^2+n^2}, \tfrac{2mn}{m^2+n^2})\). Counting lattice right triangles = counting rationals on a circle.

Geometry bridge

Explore more tools