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
How to use the GCD and LCM Calculator
- Type two or more whole numbers, separated by commas, spaces or new lines.
- The greatest common divisor and least common multiple appear immediately.
- Read the prime factorisation of each number below the results.
Features
- Works with two or more integers at once
- Shows the GCD and the LCM together
- Prime factorisation of every number entered
- Rejects duplicates and caps values to keep results exact
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