LCM and GCD calculator
Enter two or more numbers. Get the highest common factor and the lowest common multiple.
- Runs in your browser — nothing you enter is uploaded
- No sign-up, no quotas, free to use as often as you like
How it works
Adding fractions needs a common multiple; simplifying one needs a common factor. Both are shown here for any list of numbers, not just two.
How they are found
The greatest common divisor uses Euclid's algorithm, which repeatedly replaces the larger number with the remainder of dividing it by the smaller. It is over two thousand years old and still the fastest method there is. The lowest common multiple then follows from the identity that the product of two numbers equals their GCD times their LCM.
More than two numbers
Both work across a whole list by applying them pairwise — the GCD of three numbers is the GCD of the first two with the third, and the same for the LCM. Enter as many as you like, separated by spaces or commas.
Coprime numbers
If the GCD is 1 the numbers share no factor above one and are called coprime. The tool says so, because it is the case that matters when simplifying: a fraction whose numerator and denominator are coprime is already in lowest terms.
Where you use them
The LCM is the lowest common denominator for adding fractions. The GCD is what you divide a fraction by to reduce it. Both turn up constantly in scheduling problems where two cycles repeat at different intervals.
LCM and GCD calculator — questions
What is the difference between GCD and HCF?
Nothing. Greatest common divisor and highest common factor are two names for the same thing.
Can I enter more than two numbers?
Yes, as many as fifty, separated by spaces or commas.
What does coprime mean?
The numbers share no common factor above 1 — their GCD is 1.
How are negatives handled?
They are treated as their absolute values, which is the usual convention.
Why is the LCM sometimes huge?
Because it grows very quickly with coprime inputs. The LCM of several coprime numbers is close to their product.