LCM Calculator
Result
Least common multiple
- First four common multiples
- 180, 360, 540, 720
A least common multiple is the smallest whole number that every number in a list divides exactly. For 12, 18 and 30 it is 180: 180 is 15 twelves, 10 eighteens and 6 thirties, and nothing smaller works for all three. The page prints the first four common multiples as well, because the smallest one on its own is hard to check — 180 could be a multiple of each number and still not be the smallest, and seeing 180, 360, 540, 720 in order is what shows that nothing below 180 was skipped. Three routes get there. Listing multiples of each number and taking the first one they share is the one the table below uses; it is the clearest to follow and the slowest to do. Prime factorization is faster: write each number as a product of primes and keep every prime that appears in any of them, at its highest power — 12 is 2² × 3, 18 is 2 × 3², 30 is 2 × 3 × 5, so the primes needed are 2², 3² and 5, and 4 × 9 × 5 is 180. Note the difference from the greatest common factor, which keeps the lowest power of the primes they share; this page keeps the highest power of every prime that shows up at all. The third route is to factor out the greatest common factor first and multiply: for two numbers, the least common multiple times the greatest common factor equals the product of the numbers, so 4 × 6 is 24 and the factor of 4 and 6 is 2, which leaves 12. That shortcut is exact for two numbers and is a common source of mistakes beyond two, where it does not hold — the page folds the numbers two at a time instead, which is why it gives the right answer for ten of them. Coprime numbers are the easiest case: 7, 11 and 13 share no prime, so nothing cancels and the answer is their product, 1001. The multiple is what you need to add or compare fractions: 1/12 and 1/18 can only be added once both are written over 36, which is their least common multiple, and the same number is what the common denominator page computes for a set of fractions.
Multiples of 4, 6 and 8 side by side — the answer is the first number appearing in all three columns
| n | 4 × n | 6 × n | 8 × n |
|---|---|---|---|
| 1 | 4 | 6 | 8 |
| 2 | 8 | 12 | 16 |
| 3 | 12 | 18 | 24 |
| 4 | 16 | 24 | 32 |
| 5 | 20 | 30 | 40 |
| 6 | 24 | 36 | 48 |
| 7 | 28 | 42 | 56 |
| 8 | 32 | 48 | 64 |
Read across the rows and the answer is the first row where the three right-hand entries agree: 4 × 6, 6 × 4 and 8 × 3 are all 24, so the least common multiple of 4, 6 and 8 is 24. Reading it this way is the method itself, and it is why the table is a ladder rather than a result. Notice that the columns do not reach their first agreement at the same row number — 24 is the sixth multiple of 4, the fourth of 6 and the third of 8 — so the table has to be built until one number shows up in every column rather than for a fixed number of rows. Notice also that no row before it has all three agreeing: 12 appears under 4 and 6, and 16 under 4 and 8, and both are dead ends. That is the point worth taking away, because a common multiple is easy to produce and the least one is the actual question. The table is fixed at 4, 6 and 8 and does not follow the numbers you typed, and it stops at eight rows because 24 arrives before then.
Formula
12 = 2² × 3, 18 = 2 × 3², 30 = 2 × 3 × 5 ⇒ lcm(12, 18, 30) = 2² × 3² × 5 = 180, and the first four common multiples are 180, 360, 540, 720
- 12, 18, 30
- The numbers to work with, two to ten of them, each a whole number from 1 to 1000000. Spaces, commas and semicolons all separate, so 12 18 30 and 12, 18, 30 are the same input. 0, negatives and decimals are refused: a multiple is a counting statement, and every number in the list has to have one
- 2² × 3² × 5
- The primes needed, each at its highest power across the whole list: 2² from 12, 3² from 18, and 5 from 30. Taking the highest power rather than the lowest is what separates this from the greatest common factor, and it is why this number is always at least as large as the biggest input
- 180
- The answer, and the first common multiple. It is a multiple of every number in the list, and no smaller number is — which is the whole content of the word least
- 180, 360, 540, 720
- The first four common multiples, printed to make the answer checkable: they are 1, 2, 3 and 4 times the answer, and the gap between them is the answer itself. If a smaller common multiple existed it would have to fall below 180, and the list shows the sequence starts there
- lcm(a, b, c) = lcm(lcm(a, b), c)
- How more than two numbers are handled: two at a time, folding the running answer into the next number. This is the same fold the greatest common factor page uses, and the reason the multiply-and-divide shortcut above is not used here — that shortcut is only exact for two numbers
- 1000000000000
- The ceiling on the answer, not on the inputs. A list of ten six-digit numbers can reach an answer far past what a machine holds exactly, and an inexact answer here would look entirely normal. Past this the page refuses rather than prints something that is nearly right
Adding or comparing fractions is where the multiple earns its place. 1/12 and 1/18 cannot be added as they stand; both are rewritten over 36, and 36 is their least common multiple — any common multiple would do, but the least one keeps the numbers small, which is why it is the one taught first. The denominator of a sum is exactly this quantity, and the common denominator page here is the same computation applied to a set of fractions. Scheduling is the everyday version outside arithmetic: two events repeating every 12 and every 18 days line up again after 36 days, three repeating lights line up after the multiple of all three, and the question 'when do they coincide next' is the multiple, always. Gear teeth work the same way, with the meshing pattern recurring after a whole number of turns that both gears complete. In coursework the multiple is asked for directly and the table below is the expected working: it lists multiples of each number until one appears in every column. Two numbers that share no prime are the easy case — their multiple is simply the product — and recognising that saves doing any arithmetic at all.
Worked examples
The least common multiple of 12, 18 and 30
- Multiples of 12: 12, 24, 36, 48, 60, 72, 84, 96, 108, 120, … 180
- Multiples of 18: 18, 36, 54, 72, 90, 108, 126, 144, 162, 180
- Multiples of 30: 30, 60, 90, 120, 150, 180
- The first number to appear in all three lists is 180
- By prime factorization: 2² from 12, 3² from 18 and 5 from 30, so 4 × 9 × 5 = 180
The default. Note that 36 is a multiple of both 12 and 18 but not of 30, and 60 is a multiple of 12 and 30 but not of 18 — the answer has to satisfy every number in the list, not most of them. Both routes agree, and the factorization route is the one to use when the lists would run long.
Two numbers: 4 and 6
- Multiples of 4: 4, 8, 12, 16, 20, 24
- Multiples of 6: 6, 12, 18, 24
- The first shared number is 12
- Check with the product rule: 4 × 6 = 24, and the greatest common factor of 4 and 6 is 2, so 24 ÷ 2 = 12
The two-number case is the only one where the product rule holds, and the check above is worth doing once by hand because it shows why the rule stops working past two numbers: for 4, 6 and 9 the product is 216 while the answer is 36, and dividing by the factor of 4 and 6 alone does not correct for the third number. The page folds two at a time and is never caught by this.
Coprime numbers: 7, 11 and 13
- 7, 11 and 13 are all prime, so no two of them share a factor
- Nothing cancels in the product, so the least common multiple is 7 × 11 × 13
- 7 × 11 = 77, and 77 × 13 = 1001
- The first four common multiples step by 1001 each time
When no prime is shared, the answer is simply the product, and this is the only case where the answer is that large. 1001 is a familiar number for an unrelated reason — it factors as 7 × 11 × 13, which is exactly why the trick of spotting a repeating three-digit pattern works. The page handles it the same way it handles everything else.
A list where one number divides the others: 6, 8 and 12
- 12 is a multiple of 6, so 6 adds nothing that 12 does not already require
- Multiples of 8: 8, 16, 24
- Multiples of 12: 12, 24
- The first shared number is 24, and the answer is not a multiple of the largest input
The answer need not be one of the numbers you typed, which is the opposite of the greatest common factor, where the answer is always a divisor of the smallest input. Here the answer 24 is larger than every number in the list, because a common multiple has to be one that all of them divide into. Dropping the 6 changes nothing: 12 already carries every prime that 6 requires, so the fold leaves the answer alone.
Limitations
Each number must be a whole number from 1 to 1000000, and there must be between two and ten of them. The inputs are capped there, but the cap that actually matters is on the answer: the least common multiple must stay at or below 1000000000000, and a list of ten large numbers will blow past that long before it runs out of input range. Past the ceiling the page refuses instead of printing an answer, because a number that large cannot be held exactly and would come back looking like an ordinary result. Zero and negative numbers are refused: every whole number is a multiple of 0 is not a useful statement, and a least common multiple is defined over positive numbers. Decimals and fractions are refused rather than rounded, for the same reason as on the factor page. Separators may be spaces, commas or semicolons and may be mixed. Repeated entries are accepted and change nothing, and a number that divides another in the same list is simply redundant. The reference table below is fixed at 4, 6 and 8 and does not follow your input — the panel answers your numbers, the table shows how the answer is read off. The answer itself is always exact, never rounded.
Frequently asked questions
- How do I find the least common multiple by hand?
- Write out the multiples of each number until one value appears in every list. For 12, 18 and 30 that is 180: it is the fifteenth multiple of 12, the tenth of 18 and the sixth of 30. The faster route is prime factorization — keep every prime that appears anywhere in the list at its highest power, so 2², 3² and 5 for those three numbers, giving 180. Both routes are shown in the examples above.
- What is the difference between the LCM and the GCF?
- The greatest common factor is the largest number dividing all of the inputs; the least common multiple is the smallest number all of the inputs divide. The factor is never larger than the smallest input, the multiple is never smaller than the largest. By prime factorization the difference is one word: the factor keeps the lowest power of the primes they share, the multiple keeps the highest power of every prime present.
- Can I multiply the numbers together instead?
- That gives a common multiple but rarely the least one, and for two numbers the exact rule is that the product equals the least common multiple times the greatest common factor. For 4 and 6 the product is 24 and the factor is 2, so the answer is 12. Past two numbers that rule does not hold, which is why the page folds the numbers two at a time rather than multiplying them all together.
- Why does the page refuse very large answers?
- Because a machine stops holding whole numbers exactly past a certain size, and an answer that large would come back rounded while looking completely ordinary. The inputs are capped at 1000000 each, but the answer can grow far past that — a list of ten six-digit numbers multiplies out enormously — so the page also checks the answer against a ceiling and refuses rather than printing something that is nearly right.
- What is the least common multiple of two coprime numbers?
- Their product, because nothing cancels: 7 and 11 are coprime, so their least common multiple is 77. Coprime means the two numbers share no prime at all, so the highest power of each prime in the list is just that prime. Consecutive whole numbers are always coprime, and so is a prime paired with anything that is not a multiple of it.
- Where is the least common multiple used?
- Adding or comparing fractions needs a common denominator, and the smallest one is this quantity — 1/12 and 1/18 are both rewritten over 36. Outside arithmetic, anything that repeats on two cycles lines up again after their least common multiple: events every 12 and every 18 days coincide after 36 days, and gear teeth mesh in a pattern that repeats after the multiple of the tooth counts.
References
- Least common multiple — the definition, the highest-power rule for prime factorizations, and the relation to the greatest common divisor — Wolfram MathWorld (United States)
- Multiple — what it means for one number to be a multiple of another, and the smallest number that is a multiple of two given ones — Wolfram MathWorld (United States)
- Least common multiple of 1 through n — the sequence 1, 2, 6, 12, 60, 60, 420, … that shows how fast the answer grows as a list gets longer, catalogued as OEIS A003418 — OEIS Foundation Inc. (United States)
- 教育部关于印发义务教育课程方案和课程标准(2022 年版)的通知——The fifth item in the annex list of this notice is the Mathematics Curriculum Standards for Compulsory Education (2022 edition); common multiples and the least common multiple are part of the Number and Algebra strand of these standards, and the wording of the standards and the grade-band breakdown are governed by that annex — 中华人民共和国教育部