Skip to content
D DocNectar

Free GCD & LCM Calculator

Calculate the greatest common divisor and least common multiple of two numbers using the Euclidean algorithm.

100% Free No Signup Works on all devices

Last updated October 9, 2026 · Report an error

Thanks for rating!

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.

  1. Enter number A.
  2. Enter number B.
  3. 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.

Frequently asked questions

Yes, with no signup and no limit on how many calculations you run.
It's an efficient method for finding the GCD of two numbers by repeatedly replacing the larger number with the remainder of dividing it by the smaller number, until the remainder is zero.
For any two numbers, their LCM multiplied by their GCD always equals the product of the two numbers — so once you know the GCD, the LCM is a quick calculation: LCM = (a × b) / GCD.
The GCD is most commonly used to simplify fractions to their lowest terms, by dividing both the numerator and denominator by it.

Get new calculators and guides in your inbox

No spam — just new tools like GCD & LCM Calculator and practical guides.

Favorites