GCF and LCM calculator
Enter two to eight whole numbers and get the greatest common factor and the lowest common multiple, together with each number broken into primes.
How the gcf and lcm calculator works
The calculator splits each number into prime factors, the primes that multiply together to make it. The greatest common factor (also called the highest common factor, or HCF) uses the primes that every number shares. The lowest common multiple uses every prime that appears in any of them, at its highest count.
GCF is what you reach for when simplifying fractions. LCM is what you need to find a common denominator or to work out when repeating events line up.
The formula behind it
- GCF: the largest number that divides all the numbers exactly.
- LCM: the smallest number that all of them divide into exactly.
- For two numbers: GCF × LCM = the two numbers multiplied together.
A worked example
12 = 2² × 3, 18 = 2 × 3², 30 = 2 × 3 × 5. Shared by all three: one 2 and one 3, so the GCF is 6. Highest counts of every prime: 2², 3², 5, so the LCM is 4 × 9 × 5 = 180.
Questions people ask
What does GCF stand for?
Greatest common factor. You may also see HCF (highest common factor) or GCD (greatest common divisor). They all mean the same thing.
What if the GCF is 1?
The numbers are called coprime. They share no factors, so any fraction made from them is already simplified.
Why use LCM for fractions?
The LCM of two denominators is the smallest common denominator, which keeps the numbers small.
Can I use decimals?
Not here. Multiply by 10 or 100 to make them whole numbers first.