LCM & GCF Calculator
Find the Least Common Multiple and Greatest Common Factor of two or more whole numbers instantly, with the working shown.
What this calculator does
Enter a list of whole numbers and this tool finds two related but different values: the GCF (Greatest Common Factor, also called HCF) — the largest number that divides all of them evenly — and the LCM (Least Common Multiple) — the smallest number that all of them divide into evenly.
How it's calculated
The calculator uses the Euclidean algorithm to find the GCF of the list: it repeatedly applies GCF(a, b) = GCF(b, a mod b) until the remainder is zero. The LCM is then derived from the GCF using the identity LCM(a, b) = (a × b) ÷ GCF(a, b), applied across the whole list. This is the same method taught in school, just run in your browser instead of by hand.
Worked example
For 12, 18 and 30: the GCF works out to 6 — the largest number dividing all three evenly (12÷6=2, 18÷6=3, 30÷6=5). The LCM works out to 180 — the smallest number that 12, 18 and 30 all divide into evenly. Both values matter in different situations, which is why the calculator shows them together.
Common mistakes
- Confusing GCF and LCM — GCF is always smaller than or equal to the smallest input number; LCM is always larger than or equal to the largest input number.
- Forgetting that GCF(a, 0) = a by definition — a zero in your list won't break the calculation, but it also won't add any constraint.
- Assuming the GCF of two prime numbers is always 1 — true only if they're different primes; the GCF of a prime with itself is the number itself.
Where this comes up
GCF is used to simplify fractions to lowest terms (see the Fraction Calculator), and LCM is used to find a common denominator when adding fractions with different denominators, to schedule recurring events that need to align, or to figure out when two repeating cycles (like traffic lights or production runs) will next coincide.
Frequently asked questions
GCF (Greatest Common Factor) is the largest number that divides every number in your list evenly. LCM (Least Common Multiple) is the smallest number that every number in your list divides into evenly. They answer opposite questions.
Yes — enter as many numbers as you like, separated by commas or spaces, and the calculator finds the GCF and LCM across the whole list at once.
GCF is also commonly called HCF (Highest Common Factor) outside the US — they're the same calculation, just different regional naming.
No — GCF and LCM are the same regardless of the order you enter the numbers in.