Math

LCM Calculator

Find the least common multiple of two numbers in one click.

Find the least common multiple (LCM) of two numbers instantly — the smallest number both divide into evenly. Essential for adding fractions with different denominators, scheduling repeating events, and number-theory homework.

Introduction

The least common multiple (LCM) of two or more numbers is the smallest number that all of them divide into evenly. Its most famous job is adding fractions with different denominators — the LCM of the denominators is the smallest common denominator, keeping the numbers small and the arithmetic clean. But it shows up anywhere cycles align: two buses departing every 12 and 18 minutes coincide every 36 minutes (the LCM of 12 and 18), and two gears with 12 and 18 teeth realign every 36 tooth-steps. Anytime you need events to 'line up,' you are looking for a common multiple, and the least one is the first time they coincide.

The reliable way to find it is prime factorization: break each number into primes, take the highest power of each prime that appears in any of them, and multiply those together. For 12 (2^2 x 3) and 18 (2 x 3^2), that gives 2^2 x 3^2 = 4 x 9 = 36. A handy shortcut for two numbers is LCM(a,b) = a x b / GCF(a,b) — for 12 and 18, that is 216 / 6 = 36 — which is how this calculator works under the hood. Do not confuse the LCM with the GCF: the GCF is the largest divisor shared by the numbers (used for simplifying), while the LCM is the smallest multiple shared by them (used for combining). They are duals, linked by that very formula.

How it's calculated

The LCM is computed as |a × b| ÷ GCF(a, b), using the Euclidean algorithm for the GCF — fast and exact for any integers.

Worked examples

LCM of 12 and 18

Prime factors: 12 = 2^2 x 3, 18 = 2 x 3^2. Take the highest power of each prime: 2^2 x 3^2 = 4 x 9 = 36. Verify: 36 / 12 = 3 and 36 / 18 = 2, both whole numbers. Is anything smaller a common multiple? Multiples of 18 are 18, 36, ... — 18 is not divisible by 12, so 36 is indeed the least. Shortcut check: 12 x 18 / GCF(12,18) = 216 / 6 = 36.

LCM of 4, 6, and 8

Prime factors: 4 = 2^2, 6 = 2 x 3, 8 = 2^3. Highest powers: 2^3 x 3 = 8 x 3 = 24. Verify: 24/4 = 6, 24/6 = 4, 24/8 = 3 — all whole. Note that 12 is a multiple of 4 and 6 but not of 8, which is why pairwise reasoning fails with three numbers and prime factorization is the safe method.

Frequently asked questions

What is the LCM of 12 and 18?

36. It's the smallest number both 12 and 18 divide into evenly (12 × 3 = 36, 18 × 2 = 36).

When do I need the LCM?

Most often when adding or subtracting fractions with different denominators — the LCM of the denominators is the common denominator to use.

What is the difference between LCM and GCF?

The LCM is the smallest number both numbers divide into; the GCF is the largest number that divides both. For 12 and 18, the LCM is 36 and the GCF is 6.

Related calculators

References