LCM Calculator
- Updated
- Formula shown
- Free, no sign-up
Results
The LCM of 12, 18 and 30 is 180
Method 1: prime factorization 1. Write each number as a product of prime powers: 12 = 2² × 3 18 = 2 × 3² 30 = 2 × 3 × 5 2. Take the highest power of each prime that appears: 2², 3², 5 3. Multiply them: LCM = 2² × 3² × 5 = 180 Method 2: the GCD method, LCM(a, b) = a × b ÷ GCD(a, b), one pair at a time 1. LCM(12, 18) = 12 × 18 ÷ 6 = 216 ÷ 6 = 36 GCD(12, 18) by Euclid: 18 = 1 × 12 + 6; 12 = 2 × 6 + 0 2. LCM(36, 30) = 36 × 30 ÷ 6 = 1080 ÷ 6 = 180 GCD(36, 30) by Euclid: 36 = 1 × 30 + 6; 30 = 5 × 6 + 0
How to use the LCM calculator
- Type your numbers into the box, separated by commas or spaces, for example
12, 18, 30. Each must be a whole number of 1 or more. - Read the LCM at the top of the results, with the greatest common factor (GCF) and the LCM written as prime factors.
- Open the step-by-step working to see both methods. Use the Copy button to paste the working into notes.
Up to 20 numbers of up to 30 digits each are accepted. Every result is exact, because the arithmetic uses whole-number (BigInt) maths rather than the rounded floating point of an ordinary calculator. The prime-factor method is shown when every number is below 1018.
LCM formulas
LCM(a, b, c) = LCM(LCM(a, b), c)
By prime factors: LCM = product of the highest power of each prime
A multiple of a number is that number times any whole number, so the multiples of 6 are 6, 12, 18, 24 and so on. The least common multiple is the smallest positive number that is a multiple of every number in the list. Here a, b and c are the numbers, and GCD (also called the GCF or HCF) is their greatest common divisor. Dividing the product by the GCD removes the factors the two numbers share, which would otherwise be counted twice.
Worked example: the LCM of 12, 18 and 30
Prime factorization method. Write each number as a product of primes:
- 12 = 2² × 3
- 18 = 2 × 3²
- 30 = 2 × 3 × 5
The primes that appear are 2, 3 and 5. Take the highest power of each: 2², 3², 5. Multiply them: LCM = 2² × 3² × 5 = 180.
GCD method. Combine the numbers one pair at a time:
- LCM(12, 18) = 12 × 18 ÷ 6 = 216 ÷ 6 = 36
- LCM(36, 30) = 36 × 30 ÷ 6 = 1080 ÷ 6 = 180
Both methods give 180. The prime-factor method is quicker by hand for small numbers. The GCD method is better for big numbers, because Euclid's algorithm finds the GCD with a few divisions, while factoring a large number can take far longer.
LCM and GCF of common pairs
Notice that LCM × GCF equals the product of the two numbers in every row.
| Numbers | GCF | LCM | LCM × GCF |
|---|---|---|---|
| 4 and 6 | 2 | 12 | 24 |
| 6 and 8 | 2 | 24 | 48 |
| 6 and 9 | 3 | 18 | 54 |
| 8 and 12 | 4 | 24 | 96 |
| 9 and 12 | 3 | 36 | 108 |
| 10 and 15 | 5 | 30 | 150 |
| 12 and 16 | 4 | 48 | 192 |
| 12 and 18 | 6 | 36 | 216 |
| 14 and 21 | 7 | 42 | 294 |
| 15 and 20 | 5 | 60 | 300 |
| 18 and 24 | 6 | 72 | 432 |
| 20 and 30 | 10 | 60 | 600 |
| 24 and 36 | 12 | 72 | 864 |
| 7 and 11 | 1 | 77 | 77 |
LCM of every number from 1 to n
| Numbers | LCM |
|---|---|
| 1 to 4 | 12 |
| 1 to 6 | 60 |
| 1 to 8 | 840 |
| 1 to 10 | 2,520 |
| 1 to 12 | 27,720 |
| 1 to 15 | 360,360 |
| 1 to 20 | 232,792,560 |
Where the LCM is used
- Adding and subtracting fractions. The least common denominator is the LCM of the denominators. The fraction calculator uses exactly this step.
- Things that repeat on different cycles. If one bus leaves every 12 minutes and another every 18, they leave together every 36 minutes, the LCM of 12 and 18.
- Gears and patterns. Two gears with 12 and 18 teeth return to their starting positions together after 36 teeth have passed, which is 3 turns of the small gear and 2 of the large one.
Common mistakes
- Multiplying all the numbers together. 12 × 18 = 216 is a common multiple, but not the least one unless the numbers share no factors.
- Taking the lowest powers. Lowest powers of the shared primes give the GCF, not the LCM. Find the GCF on its own with the GCF calculator.
- Forgetting a prime. Every prime that appears in any number must be included in the LCM, even if it appears in only one of them.
- To see the prime factors of a single number with a factor tree, use the prime factorization calculator.
Frequently asked questions
What is the LCM of 12 and 18?
The LCM of 12 and 18 is 36. In prime factors, 12 = 2² × 3 and 18 = 2 × 3², so the LCM takes the highest power of each prime: 2² × 3² = 36. The GCD method agrees: 12 × 18 ÷ 6 = 36.
How do you find the LCM of three or more numbers?
Work one pair at a time, because LCM(a, b, c) = LCM(LCM(a, b), c). For 12, 18 and 30: LCM(12, 18) = 36, then LCM(36, 30) = 180. Or factor all three and multiply the highest powers: 2² × 3² × 5 = 180.
How are the LCM and the GCF related?
For any two positive whole numbers, LCM × GCF = the product of the numbers. For 12 and 18, 36 × 6 = 216 = 12 × 18. This only holds for two numbers, not for longer lists.
What is the LCM of the numbers 1 to 10?
It is 2,520, the smallest number that every whole number from 1 to 10 divides exactly. It is 2³ × 3² × 5 × 7. The LCM of 1 to 20 is much larger: 232,792,560.
Why do I need the LCM to add fractions?
Fractions can only be added when they count the same size of part. The LCM of the denominators is the least common denominator: for 1/4 + 1/6, LCM(4, 6) = 12, so the sum is 3/12 + 2/12 = 5/12.