GCD & LCM Calculator
Find the Greatest Common Divisor and Least Common Multiple of any numbers.
Prime Factorizations
Frequently Asked Questions
What is the GCD (Greatest Common Divisor)?▼
The GCD (also called HCF — Highest Common Factor) is the largest positive integer that divides all given numbers without a remainder. For example, GCD(12, 18) = 6, because 6 divides both 12 and 18, and no larger number does.
What is the LCM (Least Common Multiple)?▼
The LCM is the smallest positive integer that is divisible by all given numbers. For example, LCM(4, 6) = 12, the smallest number that both 4 and 6 divide into evenly.
What is the relationship between GCD and LCM?▼
For two numbers a and b: LCM(a,b) = |a × b| / GCD(a,b). This means knowing the GCD lets you calculate the LCM instantly. For more than two numbers, apply this pairwise.
Where are GCD and LCM used?▼
GCD is used to simplify fractions (divide by GCD). LCM is used to find common denominators when adding fractions. Both appear in cryptography (RSA keys), scheduling problems, and gear ratio calculations.