GCD / LCM
Find greatest common divisor and least common multiple with factor displays
About this calculator
The GCD/LCM Calculator finds the greatest common divisor and least common multiple of up to 5 integers at once. Prime factor breakdowns show exactly why each result appears. Useful for simplifying fractions, solving scheduling problems, and exploring number theory.
How to find GCD and LCM
- Enter 1 to 5 integers, separated by commas.
- Read the GCD and LCM in the result section.
- Check the prime factor breakdown to see why those values appear.
- Switch the number of inputs anytime — empty fields are ignored.
Common examples
- GCD(12, 18) = 6, LCM(12, 18) = 36
- GCD(24, 36, 48) = 12, LCM(24, 36, 48) = 144
- GCD(7, 13) = 1, LCM(7, 13) = 91 (coprime numbers)
- GCD(100, 75) = 25, LCM(100, 75) = 300
- GCD(0, 8) = 8, LCM(0, 8) = 0
Frequently asked questions
What is the difference between GCD and LCM?
The greatest common divisor (GCD) is the largest integer that divides every input without remainder. The least common multiple (LCM) is the smallest positive integer that every input divides without remainder.
Can I enter negative numbers or zero?
Yes. Negative numbers are normalized by absolute value for GCD and LCM purposes. The calculator uses the standard conventions GCD(0, 0) = 0 and LCM with any zero input equals 0.
How are the results computed?
The calculator breaks each number into its prime factors. The GCD is the product of the minimum power of each shared prime. The LCM is the product of the maximum power of each prime that appears in any input.
How does this help with fractions?
GCD simplifies a fraction: divide both numerator and denominator by their GCD. LCM finds a common denominator: the LCM of two denominators is the smallest denominator that lets you add or compare the fractions.