Find the smallest shared multiple of two positive integers with this least common multiple calculator. It shows the LCM and greatest common factor together, useful for fraction denominators, repeating intervals and matching group sizes.
Integer calculations
Least Common Multiple Calculator
Find the smallest positive multiple shared by two nonzero integers.
Least common multiple (LCM)
Enter two integers, then calculate.
- Greatest common factor
Signs do not change the LCM. If either number is zero, this calculator returns 0.
For LCM calculations on your phone, Unit Converter is free to download and includes a Least Common Multiple tool.
How to use this tool
- Enter the first integer in Number A.
- Enter the second integer in Number B. Use plain digits; leading minus signs are accepted.
- Click Calculate to see the Least common multiple (LCM) and Greatest common factor.
What is the least common multiple?
A multiple of an integer is a number obtained by multiplying it by another integer. For two positive integers, common multiples are the positive numbers that both divide exactly. The smallest of these is the least common multiple, usually abbreviated LCM and also called the lowest common multiple.
A least common multiple calculator finds that smallest shared multiple. It is useful for giving fractions a common denominator, finding when repeating cycles line up, and matching quantities that come in different group sizes.
The product of two positive integers is always a common multiple, but it may be larger than necessary. Their LCM includes only the factors needed to make the result divisible by both numbers. Every other positive common multiple is a whole-number multiple of the LCM.
Prime factors and the LCM
For small numbers, one way to find the LCM is to list their positive multiples in order and look for the first shared value. Prime factorization provides another way to see what the two numbers need in common.
A prime number is a whole number greater than one whose only positive factors are one and itself. Prime factorization writes a number as a product of primes. To build the LCM, include every prime that occurs in either number, taking each prime as many times as it appears in the number with more copies. In exponent notation, this means keeping the higher power of each prime.
The result contains enough of every prime factor to be divisible by both original numbers. Removing any required factor would make it stop being a common multiple, which explains why it is the least one.
The relationship between LCM and GCF
The greatest common factor (GCF), also called the greatest common divisor (GCD), is the largest positive integer that divides both numbers. It keeps only the prime factors shared by the two numbers, with the lower power of each. The LCM includes the factors needed by either number, with the higher power of each.
For positive integers a and b, this gives the LCM–GCF relationship:
LCM(a, b) = a × b ÷ GCF(a, b)
The product counts the shared factors from both numbers; dividing by the GCF removes the extra copy. If the GCF is one, the LCM equals the product. If one number divides the other exactly, the larger number is already their LCM.
The calculator uses this relationship and shows the GCF alongside the LCM. It first finds the GCF by the Euclidean algorithm, which repeatedly divides integers and keeps the remainder, then divides one input by the GCF before multiplying by the other.
Using the LCM as a common denominator
Fractions need a common denominator before their numerators can be added or subtracted. The denominator describes the size of the equal parts, so matching denominators means both fractions are expressed in the same-sized parts.
The least common denominator of two fractions is the LCM of their positive denominators. To rewrite a fraction with that denominator, divide the LCM by its original denominator, then multiply both its numerator and denominator by the resulting factor. This preserves the fraction’s value.
A larger common multiple can also serve as a denominator. Choosing the least one keeps the intermediate numbers smaller. After adding or subtracting the numerators, the resulting fraction may still have a common factor to remove.
When repeating intervals line up
When two activities start together and repeat at fixed whole-number intervals, their LCM gives the first positive elapsed time at which both repeat together. The intervals must be expressed in the same time unit. This applies to recurring tasks, timed signals and repeating sequences with a shared starting point.
The same relationship works for quantities. When items are supplied in two different pack sizes, the LCM of those sizes is the smallest positive total that can be made using whole packs of either size. Dividing the total by each pack size gives the number of packs needed for that option.
Negative numbers and zero
A negative sign does not change the positive multiples available from a nonzero integer, so this calculator uses the inputs’ absolute values and returns a nonnegative result. When either input is zero, it returns zero by convention. This is handled separately from the definition of the smallest positive common multiple for nonzero integers.
More tools: Browse all calculators and unit converters.
Find common multiples on your phone
Keep the Least Common Multiple tool and other math tools handy with Unit Converter. Download it free from the App Store or Google Play.

