GCD & LCM Calculator
Find the greatest common divisor and least common multiple of two or more numbers instantly.
Find the GCD and LCM of any numbers
The GCD & LCM Calculator finds the greatest common divisor and the least common multiple of two or more whole numbers at once. Enter your numbers separated by commas or spaces, and both results appear instantly. It handles any count of numbers, not just two, making it perfect for homework and quick checks.
What are GCD and LCM?
The greatest common divisor (GCD), also called the greatest common factor (GCF), is the largest number that divides all your numbers without a remainder. The least common multiple (LCM) is the smallest number that all your numbers divide into evenly. For example, for 12 and 18, the GCD is 6 and the LCM is 36.
How they are calculated
The calculator uses the Euclidean algorithm for the GCD, which repeatedly replaces the larger number with the remainder of dividing the two, until the remainder is zero — extremely fast even for big numbers. The LCM is then found with the identity LCM(a, b) = |a × b| ÷ GCD(a, b), applied across all your numbers in turn.
How to use it
- Enter two or more whole numbers, separated by commas or spaces.
- Read the GCD and LCM instantly.
- Add more numbers to compute across the whole set.
Worked examples
| Numbers | GCD | LCM |
|---|---|---|
| 12, 18 | 6 | 36 |
| 8, 12, 16 | 4 | 48 |
| 7, 13 | 1 | 91 |
Where GCD and LCM are used
- Simplifying fractions — divide numerator and denominator by their GCD.
- Adding fractions — find a common denominator using the LCM.
- Scheduling — the LCM tells you when repeating cycles align.
- Number theory — a fundamental building block in many proofs.
Private and free
All calculations run in your browser, with nothing uploaded and no limits. Use it as much as you like, free.
Frequently asked questions
What is the difference between GCD and LCM?
GCD is the largest number that divides all your numbers; LCM is the smallest number they all divide into.
Is GCD the same as GCF?
Yes. Greatest common divisor (GCD) and greatest common factor (GCF) are two names for the same thing.
Can I use more than two numbers?
Yes. Enter as many whole numbers as you like and the tool computes the GCD and LCM across all of them.
How is the GCD calculated?
It uses the Euclidean algorithm, which is fast and works even for very large numbers.