GCD and LCM Calculator
Greatest common divisor and least common multiple of any numbers.
The GCD and LCM Calculator finds the greatest common divisor and least common multiple for any list of numbers — two, three, or a whole set. GCD powers fraction simplification; LCM finds common denominators and repeating schedules.
GCD (also called HCF) is the largest number dividing every input — the number that simplifies 12/18 to 2/3. LCM is the smallest number divisible by all inputs — what you need to add 1/6 and 1/4, or to find when two buses that leave every 15 and 20 minutes meet again (every 60).
The tool computes with the Euclidean algorithm, which is exact and fast for numbers of any practical size, and shows its work transparently. Everything runs locally in your browser.
GCD (greatest common divisor)
6
largest number dividing all inputs
LCM (least common multiple)
72
smallest number divisible by all inputs
Inputs
12, 18, 24
GCD × LCM = product of the two numbers (for pairs). Used for simplifying fractions (GCD) and finding common denominators or repeating schedules (LCM).
How to use the GCD and LCM Calculator
- Enter two or more whole numbers separated by commas, spaces or newlines.
- Read the GCD — the largest shared divisor.
- Read the LCM — the smallest common multiple.
- Use GCD to simplify fractions, LCM to sync schedules.
- Check the identity GCD × LCM = product for pairs.
Frequently asked questions
What is the difference between GCD and LCM?
GCD (greatest common divisor) is the largest number that divides all inputs — it reduces fractions. LCM (least common multiple) is the smallest number all inputs divide into — it syncs cycles and denominators. For a pair, GCD × LCM = a × b.
How is GCD calculated?
With the Euclidean algorithm: repeatedly replace the larger number by the remainder of dividing it by the smaller, until one reaches zero — the other is the GCD. It is exact, fast and needs no factoring.
Why is LCM useful for real schedules?
Two recurring events (buses, machines, medications) align every LCM of their periods. If one happens every 15 minutes and another every 20, they coincide every LCM(15,20) = 60 minutes.
Related tools
View all math & statistics →Roman Numeral Converter
Convert numbers to Roman numerals and back — 1 to 3999.
MathFraction Calculator
Add, subtract, multiply and divide fractions — always simplified.
MathPrime Factorization Calculator
Break any number into its prime factors with exponents.
MathMean Median Mode Calculator
Average, middle value and most frequent — the statistics trio in one view.
MathStandard Deviation Calculator
Sample and population standard deviation, variance and mean from any dataset.
MathPermutation and Combination Calculator
Count arrangements (nPr) and selections (nCr) instantly.