Quick LCM answers with links to the working
Use these examples to check your arithmetic, then open the calculation to compare methods. The fraction rows deliberately use the same inputs to show why rational LCM and LCD are not interchangeable.
| Inputs and operation | Answer | Open example |
|---|---|---|
| LCM(12, 18) | 36 | Prime factors |
| LCM(4, 6, 8) | 24 | Three-number calculation |
| LCM(1 through 10) | 2520 | Range calculation |
| Rational LCM(1/2, 3/4) | 3/2 | Rational multiple |
| LCD(1/2, 3/4) | 4 | Equivalent fractions |
See which method to choose or read the rational LCM and LCD definitions.
How to read these examples
The tool names below match the methods described on the How it works page. Where a method has a natural limit — factorisation above 1,000,000, or the 10,000-step search budget for listing — the limit is stated in the example instead of being hidden.
Results are shown in full. Nothing here is rounded, estimated or abbreviated, and no example relies on a floating-point calculation for an integer result.
LCM word problems with answers
When will two repeating events happen together?
Two classroom timers ring together at the start. One rings every 12 minutes and the other every 18 minutes. When will they next ring together?
- Write the intervals as prime factors: 12 = 2² × 3 and 18 = 2 × 3².
- Keep the greatest power of each prime: 2² × 3² = 36.
- The timers next ring together after 36 minutes: that is three 12-minute intervals and two 18-minute intervals.
This works because both timers start together and repeat at fixed intervals. Different starting times require checking the offsets too; the LCM alone is not enough.
What is the smallest equal quantity from different pack sizes?
Pencils come in packs of 8 and erasers in packs of 12. To buy the same positive number of each with no partial packs, find LCM(8, 12) = 24. Buy three packs of pencils and two packs of erasers.
Use LCM when looking for a smallest shared multiple. If instead you are splitting fixed quantities into the greatest number of identical groups with nothing left over, that is a GCF/GCD problem.
Review the prime factorization method, then try these inputs in the LCM calculator with steps.
Try the timer example: 12 and 18 Try the pack example: 8 and 12
Two small integers with the GCD method
The identity lcm(a, b) = |a × b| ÷ gcd(a, b) handles all of these in one step each.
| Input | GCD | Working | LCM |
|---|---|---|---|
| 12 and 18 | 6 | 12 × 18 = 216; 216 ÷ 6 | 36 |
| 21 and 6 | 3 | 21 × 6 = 126; 126 ÷ 3 | 42 |
| 9 and 12 | 3 | 9 × 12 = 108; 108 ÷ 3 | 36 |
| 15 and 25 | 5 | 15 × 25 = 375; 375 ÷ 5 | 75 |
| 7 and 11 | 1 | Coprime, so the LCM is the product | 77 |
Euclid's steps for 12 and 18
- 18 mod 12 = 6
- 12 mod 6 = 0 → the last non-zero remainder is 6, so gcd(12, 18) = 6
- 216 ÷ 6 = 36, and 36 ÷ 12 = 3 with no remainder, 36 ÷ 18 = 2 with no remainder
Three or more integers: fold from the left
With more than two inputs, the same identity is applied repeatedly: lcm(a, b, c) = lcm(lcm(a, b), c). Because the LCM is associative in this way, the order of folding does not change the result.
| Input | Working | LCM |
|---|---|---|
| 4, 6, 8 | lcm(4, 6) = 12; then lcm(12, 8) = 24 | 24 |
| 10, 15, 20 | lcm(10, 15) = 30; then lcm(30, 20) = 60 | 60 |
| 14, 21, 35 | lcm(14, 21) = 42; then lcm(42, 35) = 210 | 210 |
| 20, 30, 40 | lcm(20, 30) = 60; then lcm(60, 40) = 120 | 120 |
| 6, 8, 12 | lcm(6, 8) = 24; then lcm(24, 12) = 24 | 24 |
Note the last row: once the running LCM already contains a number, that number changes nothing. This is also why, for inputs such as 4 and 12 where one divides the other, the LCM is simply 12.
Prime-power examples (inputs within the 1,000,000 factorisation limit)
| Input | Factorisation | Highest powers | LCM |
|---|---|---|---|
| 12, 18 | 2²·3 and 2·3² | 2², 3² | 36 |
| 4, 6, 8 | 2² and 2·3 and 2³ | 2³, 3¹ | 24 |
| 45, 60 | 3²·5 and 2²·3·5 | 2², 3², 5¹ | 180 |
| 50, 75, 100 | 2·5² and 3·5² and 2²·5² | 2², 3¹, 5² | 300 |
| 16, 40 | 2⁴ and 2³·5 | 2⁴, 5¹ | 80 |
Check one row by hand: 45 = 3² × 5, 60 = 2² × 3 × 5, and the product 45 × 60 ÷ gcd(45, 60) = 2700 ÷ 15 = 180. The prime-power route and the GCD route agree, as they must.
Listing multiples, with the search budget shown
Listing is the easiest method to explain, and also the first to run out of room. For 8 and 12 the multiples begin 8, 16, 24 and 12, 24, so the first shared value is 24.
The interface shows the first 12 multiples of each number. Behind the scenes the tool allows at most 10,000 candidate steps. If the exact result proves listing would exceed that budget, it skips that search, switches to Euclid, and labels the switch in the working. Coprime pairs such as 7 and 11 are exactly the case where the answer is the product (77), and where a short listing would be misleading if it were presented as the whole search.
Ladder and common division, step by step
Ladder for 12 and 18
| Step | Row | Action |
|---|---|---|
| Start | 12, 18 | — |
| 1 | 6, 9 | both entries are even, so both are divided by 2 |
| 2 | 3, 9 | 6 is divided by 2 again; the 9 is odd and carried down |
| 3 | 1, 3 | 3 divides both entries |
| 4 | 1, 1 | 3 divides the remaining 3; every entry has reached 1 |
LCM = 2 × 2 × 3 × 3 = 36
Common division for 6, 8 and 12
| Step | Row | Action |
|---|---|---|
| Start | 6, 8, 12 | — |
| 1 | 3, 4, 6 | 2 divides all three entries, so all three are divided |
| 2 | 3, 2, 3 | 2 divides 4 and 6; the 3 is carried down |
| 3 | 1, 2, 1 | 3 divides both 3s; the 2 is carried down |
No prime divides two entries of the row 1, 2, 1, so common division stops there instead of dividing the remaining 2 on its own. That leftover 2 is multiplied in with the side divisors:
LCM = 2 × 2 × 3 × 2 = 24
Binary GCD as an independent cross-check
gcd(48, 18) by binary GCD: both values are even, so halve both and keep one factor of 2, leaving 24 and 9. Reduce the even value by halving it: 24 → 12 → 6 → 3. The pair is now 3 and 9; both are odd, so subtract the smaller from the larger: 9 − 3 = 6, then remove the factor of 2 from that even result by halving 6 → 3. The pair is now 3 and 3, and subtracting gives 3 − 3 = 0, so the common value is 3. Restoring the shared factor of 2 gives gcd(48, 18) = 3 × 2 = 6. Euclid agrees: 48 mod 18 = 12, 18 mod 12 = 6 and 12 mod 6 = 0, so the last non-zero remainder is 6.
lcm(48, 18) = 48 × 18 ÷ 6 = 144
Range mode: 1 to n
Range mode computes the LCM of every integer from 1 up to n, for n up to 100. These are the classic results students meet first.
| Range | LCM | Note |
|---|---|---|
| 1 to 5 | 60 | built up as 1, 2, 6, 12, 60 |
| 1 to 10 | 2520 | divisible by every number from 1 to 10 |
| 1 to 12 | 27720 | adds the prime 11 on top of the 1-to-10 result: 2520 × 11 = 27720, and 11 first appears in this range |
Check 1 to 10 by dividing every value, not just a sample: 2520 ÷ 1 = 2520, ÷ 2 = 1260, ÷ 3 = 840, ÷ 4 = 630, ÷ 5 = 504, ÷ 6 = 420, ÷ 7 = 360, ÷ 8 = 315, ÷ 9 = 280 and ÷ 10 = 252. Each division is exact, so all ten values divide 2520. It is also the smallest such number: every common multiple must contain 2³, 3², 5 and 7 to be divisible by 8, 9, 5 and 7. These prime powers are pairwise coprime, so every common multiple is divisible by their product, 2520.
Batch LCM: check independent sets of numbers
Use Batch when each line is a separate problem, not when you want one LCM for the entire list. Enter up to 50 non-empty lines, each containing 2–20 signed integers of up to 100 digits each. The input box has a 50,000-character total limit, so these maximums cannot all be used at once. Blank lines are ignored; an invalid line is reported without discarding the valid results.
| Line | Input | LCM | GCF / GCD |
|---|---|---|---|
| 1 | 12, 18 | 36 | 6 |
| 2 | 8, 12, 20 | 120 | 4 |
The summary shows 2 / 2 successful lines, not a combined LCM. Batch uses exact integer arithmetic and reports an LCM and GCF per line; it does not run the six teaching methods separately for every row. Download saves the results as CSV for a worksheet check. A line containing only 7 is invalid because a calculation needs at least two numbers.
For one result across several inputs, use LCM of three or more numbers. For consecutive integers, use Range mode.
Large integers
Integer inputs are handled with BigInt, so large values are exact. These two examples show both cases: one where a shared factor shrinks the answer, and one where the inputs are coprime.
| Input | GCD | Result |
|---|---|---|
| 123456789 and 987654321 | 9 | 13548070123626141 |
| 10⁹⁹ + 1 and 10⁹⁹ + 3 | 1 | the exact product, a 199-digit value |
For the second row, the GCD is 1, so the LCM is the product of the two inputs, which can be written exactly without expanding it as digits:
lcm = (10⁹⁹ + 1) × (10⁹⁹ + 3) = 10¹⁹⁸ + 4 × 10⁹⁹ + 3
That expression is a 199-digit integer — the leading 1, then 98 zeros, then a 4, then 98 more zeros, and a final 3. Writing it as a power expression avoids the line-wrapping errors that long digit strings invite.
Fractions and finite decimals
Fractions are reduced first, then combined as LCM of the reduced numerators over GCD of the reduced denominators. Finite decimals are converted to exact fractions before reduction; up to 12 decimal places are accepted.
| Input | Reduced, then combined | Result |
|---|---|---|
| 1/2 and 3/4 | lcm(1, 3) = 3 over gcd(2, 4) = 2 | 3/2 = 1.5 |
| 2/3 and 4/9 | lcm(2, 4) = 4 over gcd(3, 9) = 3 | 4/3 |
| 3/8 and 5/6 | lcm(3, 5) = 15 over gcd(8, 6) = 2 | 15/2 = 7.5 |
| 0.5 and 1.25 | 1/2 and 5/4 → lcm(1, 5) = 5 over gcd(2, 4) = 2 | 5/2 = 2.5 |
This rational result is a numerator/denominator convention and is not the same thing as the lowest common denominator. The convention is documented on the About & sources page, including the community discussion it is drawn from.
The separate LCD option
When the goal is to add or compare fractions, use the LCD option instead. It reduces the denominators, finds their LCM, and rewrites every fraction as an equivalent fraction with that denominator.
| Input | Reduced denominators | LCD | Equivalent fractions |
|---|---|---|---|
| 1/6 and 1/8 | 6 and 8 | 24 | 4/24 and 3/24 |
| 2/15 and 3/10 | 15 and 10 | 30 | 4/30 and 9/30 |
Each rewritten fraction equals its original: 4/24 = 1/6 and 3/24 = 1/8, so adding them as 7/24 is valid. The LCD is a denominator, so it is reported as a positive whole number even when the original fractions were negative.
Edge cases and the conventions behind them
| Input | Result | Reason |
|---|---|---|
| LCM(−12, 18) | 36 | negatives are treated by magnitude |
| LCM(0, 5) | 0 | any zero input gives 0 by convention |
| LCM(0, 0) | 0 | the same zero convention |
| gcd(0, 0) | 0 | all-zero GCD convention |
| LCM(7, 7) | 7 | identical inputs share themselves |
| LCM(4, 12) | 12 | one input divides the other |
| LCM(2, 3, 5, 7) | 210 | four distinct primes, so the product |
Every convention in this table is applied consistently across the calculator, the batch input, the range mode and the rational mode, so a result computed one way matches the same result computed another way.
Reproduce these results yourself
Enter any pair above in the LCM calculator, or read the method notes on the How it works page. The definitions and algorithms used here are established mathematics; the reference list behind them is on the About & sources page.