GCD and LCM Calculator
Find greatest common divisor (GCD) and least common multiple (LCM) of two integers. Example: 12, 18 → GCD 6, LCM 36. Copy result.
GCD (greatest common divisor) is the largest positive integer that divides both numbers. LCM (least common multiple) is the smallest positive integer divisible by both. Enter two integers. The calculator gives GCD and LCM. Copy the result or Copy with labels.
Loading…
Examples
- 12, 18 → GCD 6, LCM 36
- 7, 11 → GCD 1, LCM 77
- 24, 36 → GCD 12, LCM 72
FAQ
What is GCD?
Greatest common divisor: the largest positive integer that divides both numbers. Example: GCD(12, 18) = 6.
What is LCM?
Least common multiple: the smallest positive integer divisible by both. Example: LCM(12, 18) = 36.
How are GCD and LCM related?
GCD(a, b) × LCM(a, b) = |a × b| for two integers (for positive a, b: GCD × LCM = a × b).
Can I use negative numbers?
GCD and LCM are usually defined for positive integers. The calculator may use absolute values.
What if one number is zero?
GCD(a, 0) = |a|. LCM(a, 0) is typically undefined or 0 depending on definition. The tool may handle it.