GCF & LCM Calculator
Greatest common factor and least common multiple of several numbers, with the working shown
Loading the tool…
Finds the greatest common factor (GCF) and least common multiple (LCM) of 2 to 10 whole numbers and shows the working by common-factor division, a prime factor table or the Euclidean algorithm. Use it to check math homework or to simplify fractions and find common denominators.
How to use
- Type whole numbers into "Numbers", separated by commas or spaces, for example 12, 18, 30. A column pasted from a spreadsheet also works.
- The GCF, the LCM, the "Common factors" and whether the numbers are coprime appear at once.
- Under "Method", choose "Divide by common factors", "Prime factor table" or "Euclidean algorithm" to see the working.
- Under "Use with fractions", see how these numbers simplify a fraction or give a common denominator.
How it works
- In the prime factor table, the GCF takes each common prime with its smallest exponent, and the LCM takes every prime with its largest exponent.
- For two numbers, their product equals GCF × LCM, and the page checks this. For three or more numbers, this rule does not hold in general.
- Each number can have up to 40 digits. For large numbers that are slow to factor, use the Euclidean algorithm.
- Your numbers and the chosen method are saved in this browser on this device.
Questions and answers
- What are the GCF and LCM of 12 and 18?
- The GCF is 6 and the LCM is 36. You can check this with 12 × 18 = 216 = 6 × 36.
- How do I find the least common multiple?
- With common-factor division, multiply all the divisors on the left and the numbers left at the bottom. For two numbers, you can also divide their product by the GCF.
- What is the Euclidean algorithm?
- Divide the larger number by the smaller one, then divide the divisor by the remainder, and repeat until the remainder is 0. The last non-zero remainder is the GCF.
- What does coprime mean?
- Numbers are coprime when their GCF is 1. Two numbers can be coprime even if neither is prime, for example 8 and 9.