GCD & LCM Calculator
Free GCD and LCM calculator. Find the greatest common divisor and least common multiple of two or more whole numbers, entered with commas or spaces.
Numbers
Enter two or more integers. Non-integer entries are ignored.
Greatest Common Divisor
6
Results
How It Works
Enter your numbers
Type two or more whole numbers separated by commas or spaces, such as 12, 18, 24.
Let it parse
The calculator reads every valid integer and ignores blanks or non-integer entries automatically.
Read the results
See the greatest common divisor (GCD) and least common multiple (LCM) of all your numbers instantly.
The greatest common divisor (GCD) and least common multiple (LCM) are two of the most useful ideas in number theory. The GCD is the biggest number that divides every value in your set evenly, while the LCM is the smallest number that every value divides into. Together they appear constantly in fraction arithmetic, scheduling problems, gear ratios and simplifying expressions.
This calculator accepts any list of whole numbers separated by commas or spaces and computes both at once. It uses the fast Euclidean algorithm for the GCD and derives the LCM from the relationship a × b ÷ GCD(a, b), combining the numbers pair by pair so the results are correct for two values or a long list alike.
Frequently Asked Questions
What is the greatest common divisor (GCD)?
The greatest common divisor — also called the greatest common factor (GCF) or highest common factor (HCF) — is the largest whole number that divides every number in a set without a remainder. For 12 and 18 the GCD is 6.
What is the least common multiple (LCM)?
The least common multiple is the smallest positive whole number that every number in a set divides into evenly. For 4 and 6 the LCM is 12. It is widely used to add fractions with different denominators.
How are GCD and LCM calculated?
This tool finds the GCD using the Euclidean algorithm, repeatedly replacing the larger number with the remainder of dividing it by the smaller until one becomes zero. The LCM of two numbers is then a × b ÷ GCD(a, b), and the result is combined across the whole list.
Can I enter more than two numbers?
Yes. Enter any number of integers separated by commas or spaces. The GCD and LCM are computed across the entire list by combining the values two at a time.
Related Calculators
Build with our GCD & LCM Calculator API
Integrate our high-speed conversion engine directly into your own applications. Get free api keys for gcd lcm calculation api and more.