Powered by NumberTally Tools · free calculators
NumberTally ToolsNumberTally Tools

LCM & GCF Calculator

Find the greatest common factor and least common multiple of two whole numbers instantly. Shows the Euclidean algorithm steps and the prime factorization — free, no sign-up.

Advanced options

Euclid's 2,300-year-old shortcut

The Euclidean algorithm finds the GCF without any factoring: divide the larger by the smaller, replace the larger with the remainder, repeat until the remainder is 0 — the last non-zero remainder is the GCF. Then LCM = a × b / GCF, because the product double-counts exactly the shared factors.

Two methods, same answer

Prime factorization breaks each number into primes — the GCF takes the lowest shared powers, the LCM the highest. Euclid's method skips factoring entirely and is far faster for big numbers. The comparison box below runs both on your numbers so you can see they agree.

Frequently Asked Questions

What is the difference between GCF and LCM?

GCF is the largest number dividing both (a divisor); LCM is the smallest number both divide into (a multiple). For 12 and 18: GCF 6, LCM 36.

How do you find the GCF without prime factorization?

Use the Euclidean algorithm: repeatedly replace the larger number with the remainder of dividing it by the smaller, until the remainder is 0.

Why do fractions need the LCM?

Adding fractions needs a common denominator, and the LCM gives the smallest one — keeping the arithmetic (and the final simplification) easy.

Can the GCF be larger than both numbers?

No — a divisor can't exceed the number it divides, so the GCF is at most the smaller of the two.

What is the LCM of two prime numbers?

Their product — primes share no factors, so GCF = 1 and LCM = a × b.