GCD & LCM Calculator

Enter two or more whole numbers to find their greatest common divisor and least common multiple — with every step shown.

⚡ Runs entirely in your browser

Separate numbers with commas, spaces or new lines.

The working, step by step

Enter some numbers above to see Euclid's algorithm worked out here.

How the GCD & LCM calculator works

Results update the moment you type — no button to press, no waiting.

1

Enter your numbers

Type two or more whole numbers, separated by commas, spaces or new lines.

2

See GCD & LCM

Euclid's algorithm runs instantly and shows the greatest common divisor and least common multiple.

3

Copy or download

Grab the result with one tap, or download the full working as a text file.

What GCD and LCM mean

The greatest common divisor (GCD), also called the highest common factor, is the largest whole number that divides every one of your numbers with no remainder. The least common multiple (LCM) is the smallest positive number that every one of your numbers divides into evenly.

This calculator uses Euclid's algorithm — one of the oldest algorithms still in use. For two numbers, it repeatedly replaces the larger number with the remainder of dividing the larger by the smaller; when the remainder reaches zero, the last non-zero value is the GCD. The LCM is then found from the identity LCM(a, b) = |a × b| ÷ GCD(a, b). For three or more numbers the tool folds the pair-wise result across the list, so GCD(a, b, c) = GCD(GCD(a, b), c) and likewise for the LCM.

It's handy for simplifying fractions, finding common denominators, scheduling repeating events, and any classroom or engineering problem where you need a shared factor or multiple.

🔒

Private by design. Your numbers never leave your device. All the maths happens right here in your browser — nothing is uploaded or stored.