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.
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?
What does it mean if the GCF is 1?
How do I find the lowest common denominator of fractions?
Does GCF × LCM = the product work for three numbers?
Sources
Official publications only. Links open the original document in a new tab.
- National Institute of Standards and Technology Special Publication 811 — Guide for the use of the SI Significant figures and rounding conventions
- National Institute of Standards and Technology CODATA fundamental physical constants Values of the fundamental physical constants