GCD / LCM

Find greatest common divisor and least common multiple with factor displays

GCD(12, 18, 24) & LCM(12, 18, 24)
GCD
6
LCM
72
Prime factors
12 = 2 × 2 × 3
18 = 2 × 3 × 3
24 = 2 × 2 × 2 × 3
Factor trees for 12, 18, 24Factor trees for 12, 18, 24121226231818293324242122623

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

  1. Enter 1 to 5 integers, separated by commas.
  2. Read the GCD and LCM in the result section.
  3. Check the prime factor breakdown to see why those values appear.
  4. 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.