Find the least common multiple or greatest common divisor of two or more whole numbers with step-by-step pairwise working, prime factorization.
Last updated
Number theory
Find the LCM or GCF of two or more whole numbers
Enter positive integers to see the least common multiple, greatest common factor, prime factorization for each number, least common denominator context, and step-by-step pairwise working.
Least common multiple
72
The least common multiple of 12, 18, 24 is 72.
Inputs
3
GCF
6
LCM
72
Prime factorization of 12
2² × 3
Prime factorization of 18
2 × 3²
Prime factorization of 24
2³ × 3
Pairwise LCM steps
Step 1
LCM(12, 18) = 36
Use GCF(12, 18) = 6, so (12 × 18) ÷ 6 = 36.
Step 2
LCM(36, 24) = 72
Use GCF(36, 24) = 12, so (36 × 24) ÷ 12 = 72.
Euclidean check for the first two numbers
1. Euclidean step
12 = 18 × 0 + 12
Keep dividing the previous divisor by the remainder until the remainder becomes 0.
2. Euclidean step
18 = 12 × 1 + 6
Keep dividing the previous divisor by the remainder until the remainder becomes 0.
3. Euclidean step
12 = 6 × 2 + 0
The remainder is now 0, so the last non-zero divisor is the GCF.
4. Relationship check
For more than two numbers, reduce the list one pair at a time instead of using the two-number product identity directly.
For lists of three or more numbers, the pairwise reduction steps show how the final result is built.
How to use this result
If these numbers are fraction denominators, 72 is the least common denominator. Use the GCF to simplify fractions or ratios. Use the LCM when you need a common denominator or the first time repeating intervals line up again.
Every input divides evenly into 72, so it is a common multiple of the full list.
LCM calculator guide: least common multiple, greatest common factor, and prime factors
An LCM calculator helps you compare whole numbers by finding both the least common multiple and the greatest common factor. It is a practical maths calculator for fractions, ratios, schedules, divisibility problems, and prime-factor based number work. This version accepts two or more positive integers, shows pairwise working steps, and explains how the answer becomes the least common denominator when the inputs are fraction denominators.
What LCM and GCF mean
The least common multiple is the smallest positive whole number that two numbers both divide into exactly. The greatest common factor, also called the greatest common divisor, is the largest whole number that divides both numbers without remainder.
These two values are closely related. The GCF helps simplify fractions and ratios, while the LCM helps combine fractions with different denominators and solve repeating-cycle problems. That is why an LCM calculator is also useful as a common denominator calculator and a problem-solving calculator.
For two numbers, the relationship a x b = GCF(a,b) x LCM(a,b) gives a compact way to check the result. For three or more numbers, the same idea is applied pair by pair: find the LCM or GCF of the first two values, then combine that running result with the next value until the full list has been reduced.
Prime factorization method
One of the clearest ways to find LCM and GCF is prime factorization. Each number is broken into prime factors, and then those factor lists are compared.
For the least common multiple, keep the highest power of every prime that appears in any input. For the greatest common factor, keep only the primes shared by every input, using the lowest power common to the whole set. Showing the factorization for every entered number makes it easier to spot where the final LCM or GCF comes from.
GCF uses the shared prime factors with the smallest exponents
Only the prime factors common to both numbers are kept, using the lowest power that appears in either factorization.
LCM uses all prime factors with the largest exponents
Every prime factor needed to cover both numbers is included, using the highest power seen in either factorization.
a x b = GCF(a,b) x LCM(a,b)
For positive integers, the product of the two numbers equals the product of their GCF and LCM.
Why this calculator is useful
A free online calculator for LCM and GCF saves time in arithmetic and algebra because it shows the key structure of the numbers, not just the final answer. That helps with simplifying fractions, matching denominators, comparing repeating intervals, and checking whether one value is a factor or multiple of another.
It is also a strong student calculator tool because prime factorization makes number relationships easier to see. When the factors are visible, the result is easier to check by hand and easier to reuse in the next step of a longer calculation.
The multi-number input is especially useful for classroom fraction problems and real-world cycle problems. You can enter denominators such as 8, 12, and 15 to get one least common denominator, or enter repeating intervals such as 6, 10, and 15 to find the first time all cycles align.
Using the LCM as the least common denominator
When fractions have unlike denominators, the least common denominator is the LCM of those denominators. If the denominators are 8, 12, and 15, the calculator finds an LCM of 120, so every fraction can be rewritten over 120 before adding, subtracting, or comparing.
Using the least common denominator is usually better than multiplying every denominator together. Multiplying 8 x 12 x 15 gives 1440, which is a common denominator but not the least one. The LCM keeps the rewritten fractions smaller, which reduces later simplification work.
Worked example: LCM and GCF of 12 and 18
The prime factorization of 12 is 2² × 3, and the prime factorization of 18 is 2 × 3². The GCF keeps the shared primes at their lowest powers, so the GCF is 2 × 3 = 6. The LCM keeps every prime needed at the highest power seen, so the LCM is 2² × 3² = 36.
That one example explains both outputs at once. It also shows why an LCM calculator is useful for fraction work: if the denominators are 12 and 18, the common denominator you can always use is 36.
If you add a third denominator, such as 24, the calculator reduces the list in another step: LCM(12, 18) = 36, then LCM(36, 24) = 72. That final 72 is the least common denominator for denominators 12, 18, and 24.
What the working steps show
This page now shows the Euclidean algorithm steps used to find the greatest common factor before it applies the product relationship between the two numbers, the GCF, and the LCM. That gives you a quick hand-check path instead of just a final answer with no explanation.
For example, once the Euclidean steps show that the GCF of 54 and 24 is 6, the identity 54 × 24 = 6 × LCM lets you solve for the LCM immediately. This is often the fastest way to verify the calculator output during homework, exam revision, or fraction work.
For a list of numbers, the calculator also shows the pairwise reduction path. That makes a multi-number LCM calculator with steps easier to audit because each intermediate LCM or GCF can be checked before moving to the next input.
When to use LCM, GCF, or a fraction-specific calculator
Use this page when your main task is finding a least common multiple, greatest common factor, or least common denominator from a list of whole-number denominators. It is the right fit for number theory practice, divisibility checks, and setting up fraction addition or subtraction.
If you need to add, subtract, multiply, or divide complete fractions, a fraction calculator can finish the arithmetic after the common denominator step. If you only need to simplify one fraction or ratio, the GCF output is usually the value that matters most.
Frequently asked questions
What is the least common multiple (LCM)?
The LCM of two or more integers is the smallest positive integer that is divisible by all of them. For example, the LCM of 4 and 6 is 12, because 12 is the smallest number that both 4 and 6 divide into evenly.
How is LCM calculated?
One method: find the prime factorisation of each number, take the highest power of each prime that appears in any factorisation, and multiply them together. Another method: LCM(a, b) = |a × b| / GCD(a, b), using the greatest common divisor.
When is LCM used in practice?
LCM is used to find a common denominator when adding or subtracting fractions with different denominators, to synchronise repeating events (such as two machines cycling at different rates), and in scheduling problems involving periodic events.
What is the difference between LCM and GCF?
LCM is the smallest whole number shared by two or more numbers as a multiple, while GCF is the largest whole number shared as a factor. LCM helps when combining cycles or fractions; GCF helps when simplifying or splitting numbers into common parts.
Can I use this calculator for more than two numbers?
Yes. Enter two or more positive whole numbers separated by commas, spaces, or line breaks. The calculator reduces the list pair by pair, so you can see how each intermediate LCM or GCF leads to the final result.
Is the LCM the same as the least common denominator?
The least common denominator is the LCM applied to fraction denominators. For example, if the denominators are 8, 12, and 15, their LCM is 120, so 120 is the least common denominator for those fractions.
Why does the calculator reject zero, negative numbers, and decimals?
This page is designed for positive whole-number LCM and GCF work. Decimals need a different interpretation, zero creates special cases for LCM, and negative signs do not change the positive divisibility structure the calculator is explaining.
What happens when the numbers are coprime?
If the numbers share no common factor greater than 1, their GCF is 1. For two coprime numbers, the LCM is their product. For a longer list, the pairwise steps show whether each new number adds new prime factors to the running LCM.
Should I use prime factorization or the GCF formula?
Prime factorization is the most explanatory method because it shows which prime powers are kept. The GCF formula is faster for two numbers and is useful for pairwise reduction in a calculator because LCM(a,b) = a x b / GCF(a,b) for positive integers.