How to use it
- Enter two or more positive whole numbers separated by commas, for example 12, 18, 30.
- Read each number's prime factorization.
- The GCF and LCM are built from those factors, and Euclid's algorithm confirms the result for the first two numbers.
What are the GCF and LCM?
The greatest common factor (GCF) is the largest number that divides every number in the list. It is also called the greatest common divisor (GCD) or highest common factor (HCF).
The least common multiple (LCM) is the smallest positive number that every number in the list divides into. For 12 and 18, the GCF is 6 and the LCM is 36.
The prime factorization method
Write each number as a product of primes. 12 = 2² × 3 and 18 = 2 × 3².
For the GCF, take each prime the numbers share, with its lowest power: 2 × 3 = 6. For the LCM, take every prime that appears, with its highest power: 2² × 3² = 36.
Euclid's algorithm
Divide the larger number by the smaller and keep the remainder. Then divide the previous divisor by that remainder, and repeat until the remainder is 0. The last non-zero remainder is the GCF.
For two numbers a and b, LCM = a × b ÷ GCF. For 12 and 18: 12 × 18 ÷ 6 = 36.
Frequently asked questions
Is GCF the same as GCD and HCF?
Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number.
What is the LCM used for?
Adding and subtracting fractions. The LCM of the denominators is the lowest common denominator.
What if the GCF is 1?
The numbers are called coprime. Their LCM is then simply their product.
Can I use more than two numbers?
Yes. Enter as many as you like, separated by commas or spaces.