GCF/LCM Calculator
This free GCF and LCM calculator finds the greatest common factor and least common multiple of 2 or more whole numbers at once. Nothing you enter is sent anywhere or stored.
How to Use It
- Enter 2 or more whole numbers, separated by commas, spaces, or new lines.
- GCF and LCM update instantly, no submit button.
How It Works
GCF is found with the Euclidean algorithm: divide the larger number by the smaller one, replace the larger number with the remainder, and repeat until the remainder is zero. Whatever number remains at that point is the GCF. For a list of more than 2 numbers, the same process is applied pairwise, finding the GCF of the first two numbers, then the GCF of that result and the next number, and so on, until every number has been folded in.
LCM builds directly on GCF rather than starting over: for any 2 numbers, their LCM equals the two numbers multiplied together, divided by their GCF. A list of more than 2 numbers folds in the same pairwise way GCF does.
A worked example: for 12 and 18, the Euclidean algorithm finds a GCF of 6 (18 divided by 12 leaves a remainder of 6, then 12 divided by 6 leaves a remainder of 0, so 6 is the GCF). Their LCM is then 12 times 18, divided by 6, which is 36.
Everything runs client-side in your browser. Nothing you enter is sent anywhere or stored.
Frequently Asked Questions
What do GCF and LCM actually mean?
The greatest common factor (GCF) is the largest number that divides evenly into every number in the list. The least common multiple (LCM) is the smallest number that every number in the list divides evenly into. They describe opposite ends of the same relationship: GCF looks for the biggest shared divisor, LCM looks for the smallest shared multiple.
How does the Euclidean algorithm find GCF without listing every factor?
Instead of listing every factor of every number and comparing them, the Euclidean algorithm repeatedly replaces the larger number with the remainder of dividing it by the smaller number, until the remainder reaches zero. Whatever number is left is the GCF. It reaches the answer in a handful of steps even for large numbers, without ever needing a full factor list.
Why is LCM calculated from GCF instead of separately?
Once GCF is known, LCM follows directly: multiply the two numbers together and divide by their GCF. This is faster and simpler than factoring each number independently to find their least common multiple, and it is guaranteed to give the same answer.
Can you give a real-world example of each?
GCF shows up when simplifying a fraction: dividing both the numerator and denominator by their GCF reduces the fraction to its simplest form. LCM shows up when adding fractions with different denominators, since the smallest common denominator is the LCM of the original denominators, and also in scheduling, like finding when two events on different repeating cycles will next fall on the same day.