GCD and LCM Calculator
Find the greatest common divisor and least common multiple of any set of whole numbers.
The greatest common divisor (GCD, also called the GCF) is the largest whole number that divides every number in a set. The least common multiple (LCM) is the smallest number they all divide into. For 12 and 18, the GCD is 6 and the LCM is 36. Enter two or more whole numbers to get both at once.
Results are estimates provided for general information.
Enter two or more positive whole numbers, separated by commas, spaces, or new lines.
Greatest common divisor (GCD)
6
Least common multiple (LCM)
72
Computed for 3 numbers with Euclid's algorithm — both results are exact.
Embed this calculator on your site →
About the GCD & LCM Calculator
The greatest common divisor and the least common multiple are two sides of the same coin, and this calculator finds both for any set of whole numbers you enter. The GCD — also called the greatest common factor, or GCF — is the biggest number that divides all of your values with no remainder. It's what you use to reduce a fraction to lowest terms or split things into the largest equal groups. The LCM is the smallest number that every value divides into evenly, which is exactly what you need to add fractions with different denominators or to work out when repeating events line up again. The tool uses the Euclidean algorithm, the same efficient method taught in number theory, and applies it across the whole list rather than just a pair. Enter your numbers separated by commas, spaces, or new lines and it returns the GCD and LCM together. One practical note: least common multiples grow very fast, so for a set of large coprime numbers the LCM can exceed the range this tool computes exactly, in which case it tells you rather than showing a rounded figure — the GCD is always exact.
Frequently asked questions
What is the difference between GCD and LCM?+
The GCD (greatest common divisor) is the largest number that divides all your values evenly; the LCM (least common multiple) is the smallest number they all divide into. For 12 and 18, the GCD is 6 and the LCM is 36. GCD shrinks toward the smallest input; LCM grows toward (and past) the largest.
Is GCD the same as GCF?+
Yes. Greatest common divisor (GCD) and greatest common factor (GCF) are two names for the same thing: the largest whole number that divides every value in the set. Some textbooks use one term, some the other.
How do you find the LCM of more than two numbers?+
Take the LCM of the first two, then the LCM of that result with the next number, and so on across the list. This calculator does it for you — enter as many whole numbers as you like.
What is the GCD and LCM used for?+
GCD reduces fractions to lowest terms and splits quantities into the largest equal groups. LCM finds a common denominator for adding fractions and works out when repeating cycles (schedules, gears, signals) next coincide.
Why does it say the LCM is too large?+
The least common multiple of large numbers that share few factors can be enormous. Beyond a certain size the value can't be represented exactly, so rather than show a rounded (and wrong) number, the calculator flags it. The GCD is always returned exactly.
Embed this calculator
Free to use on your own site. Paste this snippet where you want the gcd & lcm calculator to appear — it resizes itself automatically.
<iframe
src="https://manytools.co/embed/gcd-lcm-calculator"
title="GCD & LCM Calculator by ManyTools"
data-manytools="gcd-lcm-calculator"
width="100%"
height="640"
loading="lazy"
style="border:0;width:100%;max-width:720px"></iframe>
<script>
(function () {
window.addEventListener("message", function (e) {
if (e.origin !== "https://manytools.co") return;
var d = e.data || {};
if (d.type !== "manytools:embed:height" || d.slug !== "gcd-lcm-calculator") return;
var f = document.querySelector('iframe[data-manytools="gcd-lcm-calculator"]');
if (f && d.height) f.style.height = d.height + "px";
});
})();
</script><a href="https://manytools.co/math/gcd-lcm-calculator">GCD & LCM Calculator by ManyTools</a>