GCD & LCM Calculator
Compute the greatest common divisor and least common multiple of two or more whole numbers — arbitrary precision.
Quick answer: GCD & LCM Calculator: compute the greatest common divisor and least common multiple of two or more whole numbers — arbitrary precision. Runs entirely in your browser, free, no signup.
Last updated
Good to know
The greatest common divisor and least common multiple are two sides of the same coin: for any pair of integers, GCD(a, b) × LCM(a, b) = a × b. That identity is why this calculator derives the LCM from the GCD rather than factoring each number — the Euclidean algorithm finds the GCD in a handful of steps even for enormous inputs, whereas full factorization is slow.
The everyday use case people forget is fractions. To add 5/12 and 7/18 you need a common denominator, and the smallest one is exactly the LCM of 12 and 18, which is 36. Reducing a fraction to lowest terms uses the GCD of numerator and denominator. Gear ratios, tiling layouts, and "how often do two repeating schedules coincide" problems all reduce to the same two operations.
Because the inputs are handled as arbitrary-precision BigInt, you can paste numbers far larger than a normal calculator's 15-digit limit without silent rounding. If you need trigonometry, logarithms, or decimal arithmetic instead of exact whole-number results, reach for the scientific calculator — this tool is deliberately specialized for integer divisibility.
Frequently asked questions
- What's the difference between GCD and LCM?
- GCD (greatest common divisor) is the largest number that divides all your inputs evenly. LCM (least common multiple) is the smallest number that all your inputs divide into evenly. GCD(12, 18) = 6, LCM(12, 18) = 36.
- Can I use very large numbers?
- Yes — we use BigInt arithmetic, so 100-digit numbers work fine. The Euclidean algorithm is fast even at that size.
- How many numbers can I enter at once?
- As many as you like, separated by spaces or commas. The tool reduces them pairwise — GCD(a, b, c) = GCD(GCD(a, b), c).
- Does it handle negative numbers?
- Yes — by convention we return the positive GCD/LCM regardless of input signs.
- Is my data uploaded?
- No — calculations run entirely in your browser.