What is the LCM of 6 and 8?
24. The multiples of 8 are 8, 16 and 24, and 24 is the first one 6 divides into. The GCF is 2, and 24 × 2 is 48, or 6 × 8.
Find the LCM and GCF of two or more numbers or fractions, worked out by prime factors, the ladder method or the Euclidean algorithm.
Type two or more numbers to find their LCM and GCF.
The steps show once two numbers are in.
Both answers come from one set of numbers, with each step of the working shown in the method your teacher uses.
Free with no sign-up, and the numbers you type stay on this page.
Type your numbers, read both answers at once, then pick the method your class uses for the working.
Type each number in its own box, or paste a list like 12, 18, 24 to fill them. Add boxes for the LCM of 3 numbers.
Switch the working between prime factorization, the ladder method, the Euclidean algorithm and lists of factors.
Every step uses your own numbers, so a homework answer can be checked line by line, or copied with Copy the steps.
The least common multiple, or LCM, is the smallest number that every number in a set divides into exactly. The multiples of 4 are 4, 8, 12, 16 and on; the multiples of 6 are 6, 12, 18. The first one in both lists is 12, so the LCM of 4 and 6 is 12.
Listing multiples works for small numbers, but the LCM can be far from them: 8, 9 and 25 have an LCM of 1,800. Prime factors get there faster, and the Lists tab shows how many multiples you would have had to write out.
The LCM answers questions about things lining up again. A bus every 12 minutes and a train every 18 minutes leave together at 36 minutes past. It is also the least common denominator when fractions are added: 1/4 + 1/6 is 3/12 + 2/12.
The greatest common factor, or GCF, is the largest number that divides into every number in a set with nothing left over. The factors of 12 are 1, 2, 3, 4, 6 and 12, and of 18 they are 1, 2, 3, 6, 9 and 18. Both lists share 1, 2, 3 and 6, so the GCF is 6.
Schools use different names for it. In the UK and India it is the highest common factor, HCF; in programming and number theory it is the greatest common divisor, GCD. All three give the same answer, so this one calculator covers them all.
The GCF is how a fraction is put in lowest terms: dividing 12/18 top and bottom by 6 gives 2/3. When the GCF is 1, as for 8 and 15, the numbers share no factor at all and are called coprime, and their LCM is simply their product, 120.
Split a number into two factors, then split those again until only primes are left. This is a factor tree: 360 is 36 × 10, 36 is 6 × 6, and so on down to 2 × 2 × 2 × 3 × 3 × 5. Written with powers, 360 = 2³ × 3² × 5.
With every number in prime factors, the GCF takes each prime they all share at its lowest power, and the LCM takes every prime at its highest power. For 12 = 2² × 3 and 18 = 2 × 3², the GCF is 2 × 3 = 6 and the LCM is 2² × 3² = 36.
For two or three numbers, the Prime factors tab draws a Venn diagram. Shared primes sit where the circles overlap: multiply the middle for the GCF, and everything in the diagram for the LCM. The ladder method finds the same primes by dividing down a column.
The Euclidean algorithm finds a GCF without factoring. Divide the larger number by the smaller and keep the remainder: 48 = 2 × 18 + 12. Then divide 18 by 12 to get a remainder of 6, and 12 by 6 to get 0. The last remainder before 0 is the GCF, 6.
Once the GCF is known, the LCM of two numbers is their product divided by it: 48 × 18 ÷ 6 = 144. For three or more numbers, the steps run on a pair at a time, so the GCF of 48, 18 and 30 is the GCF of 6 and 30, which is 6.
The numbers at least halve with every two divisions, so the algorithm stays fast on numbers with hundreds of digits, where a factor tree would never finish. The Euclid tab shows each line, and very long runs are cut to the first and last lines.
Ask whether the answer splits things up or brings them together. Sharing 24 pencils and 36 erasers into identical kits with none left over is a GCF problem: the GCF of 24 and 36 is 12, so 12 kits each get 2 pencils and 3 erasers.
Waiting for things to match is an LCM problem. Hot dogs come in packs of 10 and buns in packs of 8, so the fewest of each to buy with none left over is the LCM, 40: four packs of hot dogs and five packs of buns.
Type 1/2, 3/4 and 5/6 for an LCM of 15/2 and a GCF of 1/12, from their numerators and denominators.
With fractions in the boxes the LCD comes too: 12 for 1/2, 3/4 and 5/6, each rewritten over 12.
Every factor of each number in a list, with the ones they share marked and the greatest one ringed.
The upside-down division, or cake method: primes down the side, numbers across, then multiply.
Prime factors of two or three numbers in circles: the overlap gives the GCF and the whole, the LCM.
When the GCF is 1 the numbers are coprime, or relatively prime, and the answer says so in words.
They stay on this page: the maths runs in your browser and nothing typed is sent or saved.
This LCM calculator works online, yet every division and factor tree is worked out on your device.
Nothing is kept. Work through a full GCF and LCM worksheet and no number is stored or sent anywhere.
No sign-up, email or app to install. Open the page on a phone, a school laptop or a tablet and type.
24. The multiples of 8 are 8, 16 and 24, and 24 is the first one 6 divides into. The GCF is 2, and 24 × 2 is 48, or 6 × 8.
6. Of the factors of 12 (1, 2, 3, 4, 6, 12) and of 18 (1, 2, 3, 6, 9, 18), the largest in both lists is 6. The LCM is 36.
The GCF goes into each number, so it is never above the smallest. The LCM is a multiple of each, never below the largest.
Find the LCM of two, then of that answer and the third. For 4, 6 and 10: the LCM of 4 and 6 is 12, and the LCM of 12 and 10 is 60.
For two numbers, HCF × LCM is their product: for 8 and 12, 4 × 24 = 96 = 8 × 12. With three or more numbers this no longer holds.
The greatest common divisor: another name for the GCF or HCF, used in programming. All three give the same number.
Put each in lowest terms, then divide the LCM of the numerators by the GCF of the denominators: for 2/3 and 4/9, 4 ÷ 3 = 4/3.
A number times 1, 2, 3 and so on: the multiples of 5 are 5, 10, 15 and 20. A factor is the reverse: it divides in exactly.
Still stuck, or found a problem? Email dobliquestudio@gmail.com and we will help.