Math & ScienceAny count of numbers

GCF & LCM Calculator

The greatest common factor is what you divide by to simplify; the lowest common multiple is what you multiply up to in order to combine. Both are shown here for any number of inputs, with the prime factorisation that explains them.

Numbers

Two or more whole numbers, separated by commas, spaces or new lines.

Two or more positive integers
GREATEST COMMON FACTOR
Lowest common multiple
Numbers used
Coprime?
Product of all numbers
GCF × LCM (two numbers only)
Simplified ratio

What each one is for

The GCF (also called the highest common factor) is the largest number that divides all your inputs exactly. You use it to simplify fractions and ratios, and to work out the largest identical group you can split things into without a remainder.

The LCM is the smallest number all your inputs divide into exactly. You use it to find a common denominator, and to work out when repeating cycles line up — two buses every 12 and 18 minutes meet again every 36 minutes.

The prime factorisation method

Break each number into primes. For the GCF, take each shared prime at its lowest power. For the LCM, take every prime that appears at its highest power. With 12 = 2² × 3 and 18 = 2 × 3²: the GCF is 2 × 3 = 6, the LCM is 2² × 3² = 36. Seeing both read off the same two factorisations is the fastest way to stop confusing them.

The Euclidean algorithm, and why it is still used

For large numbers, factorising is slow and unnecessary. Euclid's method repeatedly replaces the larger number with the remainder of dividing it by the smaller, until the remainder is zero — the last non-zero value is the GCF. It finishes in a handful of steps even on numbers hundreds of digits long, which is why it sits at the heart of RSA key generation more than two thousand years after it was written down.

The identity worth remembering

For exactly two numbers, GCF × LCM = the product of the two numbers. It is a quick sanity check, and it means finding one gives you the other for free. It does not generalise to three or more numbers, which is a mistake people make routinely — the calculator only reports it in the two-number case for that reason.

Frequently Asked Questions

What is the difference between GCF and LCM?
The GCF is the largest number that divides into all your inputs; it is never bigger than the smallest input. The LCM is the smallest number they all divide into; it is never smaller than the largest input.
What does it mean if the GCF is 1?
The numbers are coprime — they share no factor other than 1. This does not mean they are prime themselves: 8 and 9 are both composite yet coprime.
How do I find the lowest common denominator of fractions?
It is the LCM of the denominators. Enter the denominators above and the LCM is the denominator to convert every fraction to.
Does GCF × LCM = the product work for three numbers?
No. The identity holds only for exactly two numbers. For three or more it generally fails, which is why the calculator shows it only in the two-number case.
Where these numbers come from

Sources

Official publications only. Links open the original document in a new tab.