How to Use the Divisors & GCD/LCM Calculator
A divisor is a number that divides another number with no remainder. This calculator takes two whole numbers, lists every divisor of each one, then finds the common divisors shared by both lists, the greatest common divisor (GCD) — the largest of those common divisors — and the least common multiple (LCM) — the smallest number that both are a factor of.
Checking divisors only up to the square root of a number is enough to find every divisor pair, which keeps the calculation fast even for larger numbers. The GCD is found using the Euclidean algorithm (repeatedly dividing and keeping the remainder), and the LCM is calculated by dividing the product of the two numbers by their GCD (LCM = A×B÷GCD).
Inputs must be whole numbers between 1 and 1,000,000 — decimals and negative numbers aren't accepted.
Frequently Asked Questions
Those numbers are called coprime, and their GCD is always 1. In that case, the LCM simply equals the product of the two numbers.
Because of a mathematical identity: the product of two numbers always equals the product of their GCD and LCM (A×B=GCD×LCM). This relationship lets you find the LCM quickly without listing out every multiple by hand.