GCD & LCM Calculator

Enter 2 to 10 whole numbers to find their greatest common divisor (GCD, also known as GCF) and least common multiple (LCM). For two numbers, the Euclidean algorithm steps are shown.

Each number is a whole number of 1 or more with up to 12 digits (0, negative numbers and decimals are not accepted). Separate numbers with a comma, space or line break. Do not use commas as thousands separators: "1,000" would be read as the two numbers 1 and 000.
Greatest common divisor (GCD) —
Least common multiple (LCM)—
The copied value is the greatest common divisor (without commas). The least common multiple is always shown in full, however many digits it has.

What are the GCD and LCM?

For two numbers, GCD × LCM = the product of the two numbers (6 × 36 = 12 × 18). For more numbers, the calculator combines them one pair at a time.

The Euclidean algorithm

To find the GCD of two numbers, divide the larger by the smaller and keep the remainder. Repeat with the smaller number and the remainder until the remainder is 0. The last divisor is the GCD.

For 48 and 18: 48 ÷ 18 = 2 remainder 12; 18 ÷ 12 = 1 remainder 6; 12 ÷ 6 = 2 remainder 0. The GCD is 6.

Examples

Frequently asked questions

How do I simplify a fraction with the GCD?

Divide the numerator and the denominator by their GCD. For 18/24 the GCD is 6, so 18/24 = 3/4.

How do I find a common denominator?

The least common multiple of the denominators is the least common denominator. For 1/4 and 1/6 the LCM of 4 and 6 is 12, so the common denominator is 12.

Is GCD the same as GCF?

Yes. GCD (greatest common divisor), GCF (greatest common factor) and HCF (highest common factor) are different names for the same number.