GCD and LCM Calculator

Find the greatest common divisor and least common multiple of two or more integers, with each number broken into prime factors.

GCD and LCM calculator

GCD: —
LCM: —
Count: —
Prime factorisation
Up to 20 integers, each up to 1,000,000,000. Everything is computed locally in your browser.

How to use the GCD and LCM Calculator

  1. Type two or more whole numbers, separated by commas, spaces or new lines.
  2. The greatest common divisor and least common multiple appear immediately.
  3. Read the prime factorisation of each number below the results.

Features

Advertisement

Frequently Asked Questions

Common questions about the free online gcd and lcm calculator.

The GCD is the largest whole number that divides every number in your list without a remainder. For 12 and 18 it is 6.
The LCM is the smallest number that all of your numbers divide into exactly. For 4 and 6 it is 12.
Enter all three separated by commas and the tool applies the Euclidean algorithm repeatedly, so 12, 18 and 24 give a GCD of 6.
The same list gives the LCM as well. It is built up one number at a time, so no manual factor trees are needed.
Each number is written as a product of primes with exponents, so 360 appears as 2 to the power 3 times 3 squared times 5.
The GCD takes the lowest power of each shared prime and the LCM takes the highest power of every prime that appears.
Zero is ignored because it has no finite multiple. Negative signs are removed, since divisibility depends on the size of the number only.
You can enter up to 20 numbers, each up to one billion. Larger values are skipped so that the factorisation stays fast and exact.
No. The whole calculation happens in your browser and nothing is sent to a server.

Last updated: October 10, 2026