GCD & LCM Calculator
Find the greatest common divisor (GCD) and least common multiple (LCM) of two or more numbers, with Euclid’s algorithm steps and the prime factorization method for study.
Free, no sign-up
Your data stays on your device
Works offline after first open
The tool
Loading the tool…
How to use
- Type the numbers separated by commas or spaces (2 to 20 numbers).
- The GCD and LCM appear right away.
- Below you see Euclid’s steps and the factorization table, and for two numbers the Bézout coefficients.
Privacy & how it works
Processes your data in the browser and stores nothing.
- Engine: lightweight in-page code, no external libraries.
- Works offline after you open it once.
Frequently asked questions
How does Euclid’s algorithm work?
Divide the larger number by the smaller and keep the remainder, then repeat with the smaller number and the remainder until the remainder is zero. The last non-zero divisor is the GCD. For more numbers repeat it: gcd(a, b, c) = gcd(gcd(a, b), c).
How are GCD and LCM related?
For two numbers, GCD × LCM = the product of the numbers, so knowing one gives the other.
What does “coprime” mean?
Their GCD is 1: they share no factor other than 1, like 8 and 15.
Related tools
Prime Number CheckerCheck whether a number is prime (even huge ones), factor it into primes, list its divisors and the nearest primes, and find every prime in a range.Fraction CalculatorAdd, subtract, multiply and divide fractions and mixed numbers, simplify any fraction and convert it to a decimal and a percentage, with the steps shown: common denominator and greatest common divisor.Ratio & Proportion CalculatorSimplify ratios (12:18 = 2:3), solve proportions with an unknown (3 : 4 = x : 12), split an amount by a ratio with an exact total, and scale a ratio for image sizes or recipes.Scientific CalculatorScientific calculator with a full expression line and on-screen keys: trig in degrees or radians, logs, roots, powers, factorial and percent, plus a history of your recent calculations.