LCM and GCF Calculator
Free LCM and GCF calculator: the least common multiple and greatest common factor of two or more numbers, with the prime factorization of each one.
What it does
The greatest common factor (GCF, also called greatest common divisor) is the largest number that divides all the given numbers, and the least common multiple (LCM) is the smallest number that all of them divide. This calculator finds both with Euclid's algorithm, which works for numbers of any size, and shows the prime factorization of each number so you can see where the result comes from.
How to use it
- Type two or more whole numbers separated by commas or spaces.
- See the GCF and the LCM at once.
- Check the prime factorization of each number below the result.
The arithmetic runs in your browser. Nothing you type is sent anywhere and nothing is stored, so you can use these with real numbers.
Frequently asked questions
How do I find the GCF and LCM with prime factors?
Factor each number into primes. The GCF multiplies the common primes with their smallest exponents; the LCM multiplies all the primes with their largest exponents. For 12 = 2² × 3 and 18 = 2 × 3², the GCF is 2 × 3 = 6 and the LCM is 2² × 3² = 36.
What is the relation between GCF and LCM?
For two numbers, GCF × LCM = the product of the numbers. For 12 and 18: 6 × 36 = 216 = 12 × 18. This does not hold for three or more numbers.
What is the LCM used for?
To add and subtract fractions (the LCM of the denominators is the least common denominator) and to find when repeating events coincide, such as two buses that leave every 12 and 18 minutes and meet again every 36.
What does it mean when the GCF is 1?
The numbers are coprime: they share no prime factor. In that case their LCM is simply their product, and a fraction made of them is already in lowest terms.
🧮 Prime Factorization Calculator
½ Fraction Calculator
🥧 Simplify Fractions Calculator