Math Calculators
LCM Calculator
The least common multiple is the smallest number that every entry divides into; the greatest common divisor is the largest number that divides every entry. Enter two to six whole numbers and this page returns either answer exactly — with each number’s prime factorisation and the divisions the Euclidean algorithm actually took printed beside it.
Calculator
Formula
Two definitions carry the whole page. The greatest common divisor of a list is the largest whole number that divides every entry without a remainder — gcd(9, 12, 15) = 3. The least common multiple is the smallest whole number that every entry divides into — lcm(9, 12, 15) = 180. The two are not independent. The Euclidean algorithm reduces the list by repeated exact division — 36 = 1 × 24 + 12, then 24 = 2 × 12 + 0, so gcd(36, 24) = 12 — and for any two numbers the identity lcm(a, b) × gcd(a, b) = a × b holds, which is where 36 × 3 = 108 = 9 × 12 comes from. This page takes the exact route on purpose: the Euclidean algorithm works on integer remainders alone, and the multiple is built as a × (b ÷ gcd) — the exact division first, the multiplication second — so no logarithm and no chain of floating-point multiplications is in the path. A route that goes through logarithms prints the least common multiple of 211, 204 and 3 as 43043.99999999999; the exact route prints 43044. Every entry must be a positive integer at or below 9,007,199,254,740,991 (2⁵³ − 1), the largest integer that can be held exactly, and an answer past that boundary is refused rather than printed rounded. A zero is refused rather than answered with 0, because the multiple is not defined for zero.
About This Calculator
What It Does
This page answers one list of whole numbers in four directions. In its least-common-multiple mode it prints the smallest number every entry divides into; in its greatest-common-divisor mode, the largest number that divides every entry; in its both mode it prints the pair together with the identity lcm(a, b) × gcd(a, b) = a × b, written out for the first two numbers; and in its factorisation mode it builds the multiple from the highest power of each prime. Beside the result it always prints each entry’s prime factorisation and the divisions the Euclidean algorithm took. The list holds two to six numbers.
Worked Example
The page opens on 9, 12 and 15 in least-common-multiple mode. Their prime factorisations are 9 = 3², 12 = 2² × 3 and 15 = 3 × 5, so the multiple is 2² × 3² × 5 = 180, and the divisor is 3, because 3 divides all three numbers. The Euclidean reduction prints 12 = 1 × 9 + 3, then 9 = 3 × 3 + 0 and finally 15 = 5 × 3 + 0, whose last non-zero remainder is that 3. Switch Find to Both and the identity is written out for the pair 9 and 12: 36 × 3 = 9 × 12 = 108.
Real-World Usage
Use it to add or compare fractions, whose denominators have to be brought to a common multiple first; to work out when two repeating events fall together again, such as two machines on different cycles or two bodies in orbit; to split a quantity into equal groups with nothing left over, which is what the divisor answers; and to check a prime factorisation you have done by hand, since the page prints the primes it used.
Local Context
The least common multiple and the greatest common divisor are properties of the numbers and not of the country, so nothing here changes with your location and one page serves all nine countries. Two things are worth knowing about the numbers themselves. The names differ by language — LCM and GCD in English, MCM and MCD in Spanish, PPCM and PGCD in French, mcm and MCD in Italian, MMC and MDC in Portuguese, kgV and ggT in German — and this page uses the names of the language you are reading it in. And the figures are formatted in that language’s own convention, so the same answer reads 9,007 in German and 9,007 in English while a four-digit figure reads 1.800 in Spanish and 1,800 in English. The entries themselves are separated by the point in every language, exactly as in 9.5.
Sources and Methodology
The definitions on this page are the standard ones for the greatest common divisor and the least common multiple, and the identity lcm(a, b) × gcd(a, b) = a × b is the standard product identity for a pair of positive integers. The Euclidean algorithm is the division form given in the English-language Wikipedia article "Euclidean algorithm" (October 2026). The exact-integer boundary of 2⁵³ − 1 is the double-precision limit of the IEEE 754 format, not a convention of this page, and the floating-point failure quoted in the formula section — the multiple of 211, 204 and 3 read through logarithms — was measured on this page’s own code on 2026-10-15 and is pinned by its test suite.
Last reviewed: October 2026.
Frequently Asked Questions
What is the difference between the least common multiple and the greatest common divisor?
They are opposite questions about the same list. The greatest common divisor is the largest number that divides every entry: for 9, 12 and 15 that is 3, because 3 divides all three and no larger number does. The least common multiple is the smallest number that every entry divides into: 180, because 180 is divisible by 9, by 12 and by 15, and nothing smaller is. One asks for the biggest shared divisor, the other for the smallest shared multiple.
Why does this page refuse a zero instead of showing 0?
Because the least common multiple is not defined for zero. Some calculators answer 0 whenever an entry is zero, which reads as if zero were a multiple of the other numbers the way 15 is a multiple of 5 — it is not. The convention gcd(0, x) = x does exist for the divisor, but this page holds to one rule for the whole list: every entry is a positive integer, and a zero is refused with its reason rather than answered with a figure that means something different from the rest.
Why is a decimal refused?
Because divisibility is a question only a whole number can answer. It is true that 2.5 divides 5, but "the largest number that divides every entry" would then be a question about real numbers, where the answer is not a divisor at all — every positive real divides every other one. The page therefore asks for whole numbers and says so, instead of silently cutting the decimal off and computing a different question.
Why print the factorisations and the Euclidean divisions at all?
Because the working is what lets you check the answer by hand. Every figure on this page comes from the same integer arithmetic: the primes printed beside the result are the primes the multiple is built from, and the divisions are the ones the greatest common divisor actually took — the last non-zero remainder is the answer. Nothing is recomputed for display, so the working and the answer cannot disagree.
Related Tools
Percentage Calculator
Calculate percentages, find what percent one number is of another, and more.
Ratio Calculator
Simplify a ratio to its lowest terms, solve the missing term of a proportion, or scale a ratio by a factor.
Exponent Calculator
Raise a number to any power, or take any root — the answers are exact whenever the mathematics is, and the eight exponent rules stand beside the result.