GCD and LCM Calculator
Free GCD and LCM calculator for 2 to 10 integers, with step-by-step working.
How to use
- Enter numbers separated by commas, spaces, or new lines (e.g. 12, 18, 30).
- Press “Calculate”.
- See the GCD and LCM with step-by-step working.
Examples
- 12, 18 → GCD 6 / LCM 36
- 8, 12, 20 → GCD 4 / LCM 120
When to use it (grade level)
The greatest common divisor and least common multiple are taught from around 5th grade and are used again and again for simplifying and finding common denominators in middle school. This tool suits checking home study, reviewing worksheets, and confirming exam-style calculation practice.
The greatest common divisor (GCD) is the largest number that divides two or more numbers evenly. The least common multiple (LCM) is the smallest number that is a multiple of two or more numbers.
How the two differ
The GCD is about dividing, so it is no larger than the original numbers. The LCM is about multiples, so it is no smaller than the original numbers. Because the names look alike, it helps to link 'divisor' with dividing and 'multiple' with multiplying.
For 12 and 18, the GCD is 6 and the LCM is 36. Six divides both 12 and 18, and 36 is the smallest number that is a multiple of both.
Two methods (listing and prime factorization)
Listing means writing out the divisors or multiples. The divisors of 12 are 1, 2, 3, 4, 6, 12; the divisors of 18 are 1, 2, 3, 6, 9, 18. The largest shared one, 6, is the GCD. Writing out multiples and finding the first match gives the LCM.
Prime factorization is faster. With 12 = 2^2 × 3 and 18 = 2 × 3^2, take the shared primes at their lowest powers, 2 × 3 = 6, for the GCD, and all primes at their highest powers, 2^2 × 3^2 = 36, for the LCM.
Common mistakes
Two slip-ups are common. First, mixing up GCD and LCM by confusing 'largest/smallest' with 'divisor/multiple'. Second, handling three or more numbers: with prime factorization, the GCD collects only the primes shared by all of them, while the LCM collects every prime that appears in any of them.
For 8, 12, 20: 8 = 2^3, 12 = 2^2 × 3, 20 = 2^2 × 5. The only factor shared by all three is 2^2, so the GCD is 4, and collecting all primes at their highest powers gives 2^3 × 3 × 5 = 120 for the LCM.
The link to fractions
Finding a common denominator for adding or subtracting fractions uses the LCM, and simplifying an answer uses the GCD. In other words, this tool is the foundation of fraction arithmetic. Factorizing the numbers first with the prime factorization calculator makes the mechanics clear.
FAQ
Can I use more than two numbers?
Yes, up to 10 numbers.
Can I enter zero?
The first version supports positive integers only.
Is this related to fractions?
Yes. LCM helps with common denominators, and GCD helps simplify fractions.