Last updated October 9, 2026 · Report an error
The greatest common divisor (GCD) is the largest number that divides evenly into two numbers, while the least common multiple (LCM) is the smallest number that both divide into evenly — two of the most fundamental building blocks in number theory.
This calculator uses the Euclidean algorithm, the fastest known method for finding the GCD, and shows every division step.
How it works
Enter two whole numbers. The calculator repeatedly divides the larger by the smaller and keeps the remainder, until the remainder reaches zero — the last non-zero remainder is the GCD. The LCM is then found using the relationship LCM = (a × b) / GCD.
- Enter number A.
- Enter number B.
- Click Calculate to see your results.
Examples
Simplifying a fraction
To simplify 48/18, find the GCD (6) and divide both numbers by it, giving the simplified fraction 8/3.
Who should use it
- Simplifying fractions to their lowest terms.
- Finding a common scheduling interval (LCM) for two repeating events.
Industry applications
- Mathematics education
- Computer science (cryptography, scheduling algorithms)
Advantages
- Uses the efficient Euclidean algorithm rather than brute-force factoring.
- Shows every division step of the algorithm.
Limitations
- Only supports two numbers at a time — for the GCD/LCM of three or more numbers, apply it pairwise.
Common mistakes to avoid
- Trying to list all factors of large numbers by hand to find the GCD, which is much slower than the Euclidean algorithm.
- Confusing GCD and LCM — GCD is always less than or equal to the smaller number, while LCM is always greater than or equal to the larger number.
Best practices
- Use the Euclidean algorithm rather than factoring for larger numbers — it finds the GCD in only a handful of steps regardless of how large the numbers are.
Tips
- If two numbers share no common factors other than 1, their GCD is 1 and they're called "coprime" — their LCM is simply their product.