GCD and LCM Calculator
Enter two or more positive whole numbers separated by commas or spaces.
Result
Enter values and press Calculate to see the result.
Formula
For two numbers, the GCD and LCM multiply to the product of the numbers.
How to use this calculator
- Type the numbers, e.g. 12, 18, 30.
- Press Calculate to see the GCD, the LCM and each number’s prime factorisation.
Worked example
GCD and LCM of 12 and 18
12 = 2² × 3 and 18 = 2 × 3².
GCD takes the lowest powers: 2 × 3 = 6. LCM takes the highest: 2² × 3² = 36.
Frequently asked questions
Is GCD the same as HCF or GCF?
Yes. Greatest common divisor, highest common factor and greatest common factor all mean the same thing.
Where is the LCM used?
Adding fractions uses the LCM of the denominators — the least common denominator.