Euclidean algorithm

GCD & LCM Calculator

Enter two or more whole numbers to find their greatest common divisor and least common multiple instantly.

Greatest common divisor
Least common multiple

How it works

1

Enter your numbers

Type two or more whole numbers separated by commas or spaces.

2

Euclidean algorithm runs

The GCD is found by repeated division, shown step by step for two numbers.

3

Get GCD and LCM

Read both results instantly, computed from the GCD using gcd(a,b) × lcm(a,b) = a × b.

FAQ

What is the GCD used for?

The greatest common divisor (GCD) is the largest number that divides all given numbers evenly. It's commonly used to simplify fractions to their lowest terms.

What is the LCM used for?

The least common multiple (LCM) is the smallest number that all given numbers divide into evenly. It's commonly used to find a common denominator when adding or comparing fractions.

How does the Euclidean algorithm work?

It repeatedly replaces the larger number with the remainder of dividing it by the smaller number, until the remainder is 0 — the last non-zero remainder is the GCD.

Try other tools