The least common multiple (LCM) is the smallest positive whole number that every number in a set divides into evenly. Find it by writing each number as prime factors and multiplying each prime at its highest power. For 12, 18 and 30 that is 2^2 x 3^2 x 5 = 180. For two numbers, LCM = a x b / GCD.
Least common multiple (LCM)
Calculations run in your browser. Inputs are not sent to our servers; anything you Save stays in this browser only.
Saved results (0)
How to Use the LCM Calculator
- Enter two or more whole numbers. Type or paste them with commas, spaces or line breaks between them.
- Check the count. The "Numbers read" line shows how many values the tool found, so a stray comma cannot slip past.
- Read the LCM and the working. The prime factors of each number, the LCM as prime powers and the pairwise GCD steps appear under the result.
| Result | What it tells you |
|---|---|
| Least common multiple | The smallest positive number that every input divides into with no remainder. |
| Greatest common divisor | The largest number that divides every input. It is the partner of the LCM. |
| LCM as prime factors | Each prime raised to the highest power found in any input. |
| Prime factors of each number | The factorization the method starts from. |
| GCD relation check | For two numbers, shows LCM x GCD equals the product of the numbers. |
| LCM divided by each number | How many times each number fits into the LCM. For fractions, this is what you multiply each numerator by. |
| Verdict band | Whether the LCM is the largest input, the plain product, or something in between. |
What Is the Least Common Multiple?
The least common multiple of a set of whole numbers is the smallest positive number that is a multiple of each of them. The NIST Dictionary of Algorithms and Data Structures gives the example LCM(6, 10) = 30: 30 is the first number that both 6 and 10 divide.
A multiple of a number is that number times a whole number, so the multiples of 6 are 6, 12, 18, 24, 30 and so on. A common multiple appears in every list. There are infinitely many common multiples (30, 60, 90 for 6 and 10), and the LCM is the least of them.
The LCM is the mirror image of the greatest common divisor (GCD), also called the highest common factor. The GCD is the biggest number that goes into all the inputs; the LCM is the smallest number that all the inputs go into. You can compute the GCD on its own with the GCD calculator.
Students meet the LCM first as the least common denominator when adding fractions such as 1/12 + 1/18.
How Does the LCM Calculator Work?
The tool uses the prime factorization method, then confirms the answer with the GCD relation.
GCD relation (two numbers): LCM(a, b) x GCD(a, b) = a x b
- Factor each number into primes by trial division: 12 = 22 x 3, 18 = 2 x 32, 30 = 2 x 3 x 5.
- List every prime that appears anywhere: 2, 3 and 5.
- Take the highest exponent of each prime: 22, 32 and 51.
- Multiply them: 4 x 9 x 5 = 180.
- Check with the GCD. The GCD uses the lowest exponent of the primes common to all numbers, here 2 x 3 = 6. For more than two numbers, the tool applies LCM(a, b) = a x b / GCD(a, b) one pair at a time, and both routes must agree.
University of Maryland number theory notes prove the relation LCM(a, b) x GCD(a, b) = ab for any positive integers a and b. It holds for two numbers at a time, not for three or more at once.
LCM Example: 12, 18 and 30
Three buses leave a depot together. One returns every 12 minutes, one every 18 minutes and one every 30 minutes. When do all three next meet?
| Number | Power of 2 | Power of 3 | Power of 5 |
|---|---|---|---|
| 12 | 22 | 3 | - |
| 18 | 2 | 32 | - |
| 30 | 2 | 3 | 5 |
| Highest | 22 = 4 | 32 = 9 | 5 |
LCM = 4 x 9 x 5 = 180. The buses meet again after 180 minutes, or 3 hours. By then the first bus has made 15 trips, the second 10 and the third 6.
Pairwise check: LCM(12, 18) = 12 x 18 / 6 = 36, then LCM(36, 30) = 36 x 30 / 6 = 180. Same answer.
A two-number check with 24 and 90: the GCD is 6, so the LCM is 24 x 90 / 6 = 2,160 / 6 = 360. That matches 23 x 32 x 5 = 360.
Factors That Change the LCM
Shared prime factors, the size of the numbers and special values such as 1 and 0 shape the result.
Shared Prime Factors
The more primes the numbers share, the smaller the LCM is compared with their product. 12 and 18 share 2 x 3, so their LCM is 36, not 216.
Numbers with No Common Factor
When no two numbers share a prime, the LCM is their product. LCM(3, 5, 7) = 105. Numbers like these are called pairwise coprime.
One Number Divides the Others
When the largest number is a multiple of all the rest, it is the LCM. LCM(4, 8, 16) = 16.
The Number 1 and Duplicates
1 divides everything, so it never changes the LCM. Typing the same number twice also has no effect.
Zero and Negatives
A 0 in the list makes 0 the only common multiple, so the tool returns 0 with a warning. Negative signs are dropped, because the LCM is taken as a positive number.
LCM vs GCD: How They Compare
The LCM and the GCD come from the same prime factorization; one takes the highest powers and the other the lowest.
| Question | LCM | GCD |
|---|---|---|
| Definition | Smallest number all inputs divide | Largest number that divides all inputs |
| Prime powers used | Highest exponent of every prime present | Lowest exponent of primes common to all |
| Size | At least as large as the largest input | At most as large as the smallest input |
| For 12 and 18 | 36 | 6 |
| Typical use | Common denominators, repeating schedules | Reducing fractions, splitting into equal groups |
| Fastest method | a x b / GCD(a, b) | Euclid algorithm |
Three Ways to Find the LCM
Listing multiples works for small numbers but grows slow. Prime factorization shows the structure and handles many numbers at once. The GCD route is fastest for two large numbers, because the Euclid algorithm finds the GCD without factoring.
When to Use the LCM
Adding and Subtracting Fractions
To add 1/12 + 1/18, use the LCM 36 as the common denominator: 3/36 + 2/36 = 5/36. The "LCM divided by each number" line gives the 3 and the 2. For the full fraction arithmetic, a fraction calculator does the rest.
Repeating Schedules
Events on different cycles line up at the LCM of the cycle lengths: buses, shift rotations, maintenance intervals or two blinking lights.
Buying in Packs
Buns come in packs of 8 and hot dogs in packs of 10. The smallest equal count is LCM(8, 10) = 40: 5 packs of buns and 4 packs of hot dogs.
Gears and Rhythms
Two gears with 12 and 18 teeth return to the same starting mesh after 36 teeth pass, which is 3 turns of the small gear and 2 of the large one. Musicians use the same idea for polyrhythms.
Common Mistakes When Finding the LCM
1. Multiplying the Numbers Together
12 x 18 = 216 is a common multiple, but not the least. The product is the LCM only when the numbers share no prime factor.
2. Using the Lowest Powers
Taking the lowest exponents gives the GCD, not the LCM. For the LCM, every prime appears at its highest power.
3. Dropping a Prime
A prime that appears in only one number still belongs in the LCM. Leaving out the 5 from 30 would give 36, which 30 does not divide.
4. Applying LCM X GCD = Product to Three Numbers
For 12, 18 and 30 the LCM is 180 and the GCD is 6, but 180 x 6 = 1,080 while 12 x 18 x 30 = 6,480. The relation only holds for two numbers.
5. Stopping the Multiples List Too Soon
When listing multiples by hand, extend both lists until a match appears. For 24 and 90 the first match is 360, the 15th multiple of 24.
6. Factoring Large Numbers Wrongly
A slip in one factorization spoils the answer. Check each factorization by multiplying it back out, or raise primes to powers with the exponent calculator.
Accuracy and Limitations
Results are exact: the LCM is built with arbitrary-size whole-number arithmetic, so even very large LCMs have no rounding.
What it calculates accurately
- The exact LCM and GCD of 2 to 50 whole numbers.
- Inputs up to one trillion each, with LCMs of any length.
- The prime factorization of each input and of the LCM.
- The LCM x GCD = a x b check for two numbers, and pairwise steps for more.
- Negative inputs (by absolute value) and a 0 in the list.
What it does not account for
- Decimals and fractions; the LCM is defined for whole numbers.
- The LCM of polynomials or algebraic terms.
- Thousands separators inside the list; 1,200 reads as 1 and 200.
- Real-world limits such as closing times or pack sizes that are not sold.
Perfect powers show up in the factor list too; a factor such as 23 x 33 means the number is a perfect cube, which the cube root calculator confirms.
How We Calculate the LCM
Frequently Asked Questions About the LCM
What is the LCM of 6 and 8?
It is 24. 6 = 2 x 3 and 8 = 2^3, so the LCM is 2^3 x 3 = 24.
What is the LCM of 1 to 10?
It is 2,520, the smallest number that 1, 2, 3 and every whole number up to 10 divide evenly. It equals 2^3 x 3^2 x 5 x 7.
How do I find the LCM using the GCD?
Multiply the two numbers and divide by their GCD. For 24 and 90, 2,160 / 6 = 360.
Can the LCM be smaller than one of the numbers?
No. The LCM is a multiple of every input, so it is at least as large as the largest one.
What is the LCM of two prime numbers?
It is their product, because two different primes share no factor. LCM(7, 11) = 77.
Is the LCM the same as the least common denominator?
Yes, when the numbers are fraction denominators. The least common denominator of 1/4 and 1/6 is LCM(4, 6) = 12.
How do I find the LCM of three numbers?
Factor all three and take each prime at its highest power, or find the LCM of two and then of that result with the third.
What is the LCM of 0 and 5?
By convention it is 0, since 0 is a multiple of every number. Most courses only ask for the LCM of nonzero numbers.
Can I find the LCM of decimals?
Not directly. Scale the decimals to whole numbers first, for example 0.4 and 0.6 become 4 and 6 with LCM 12, then scale back to 1.2.
Are my numbers stored?
No. The calculation runs in your browser, and Save keeps a copy only in your own browser storage.
Sources
- Prime factorization and the least common multiple (OpenStax Prealgebra 2e, section 2.5).
- LCM of a set of numbers using the largest exponent of each prime (OpenStax Contemporary Mathematics, section 3.1).
- Proof that LCM(a, b) x GCD(a, b) = ab (University of Maryland, Department of Mathematics).
- Least common multiple definition, LCM(6, 10) = 30 (NIST Dictionary of Algorithms and Data Structures).
Related Calculators
Need another number theory or arithmetic tool?
Explore all math calculatorsThis calculator is for study, homework and everyday planning. It works with whole numbers only and reports exact results. Check any schedule or engineering use against the real constraints of the job. Spotted an error? Let us know.
Author
Shakeel Muzaffar is the Founder and Editor-in-Chief of MultiCalculators.com, bringing over 15 years of experience in digital publishing, product strategy, and online tool development. He leads the platform's editorial vision, ensuring every calculator meets strict standards for accuracy, usability, and real-world value. Shakeel personally oversees content quality, formula verification workflows, and the platform's commitment to publishing tools that are genuinely useful for students, professionals, and everyday users worldwide.




