CompoundPage

GCF and LCM Calculator

The GCF and LCM calculator finds both at once, with the prime factorization that produces them. The GCF takes the lowest power of each shared prime and the LCM takes the highest.

Leave at 0 to use two numbers only.

Which result leads. Both the GCF and the LCM are still calculated.

Greatest common factor12

Least common multiple
720
Numbers
48, 180
Prime factorizations
48 = 2^4 x 3 180 = 2^2 x 3^2 x 5
GCF takes the lowest power of each shared prime
2^2 x 3 = 12
LCM takes the highest power of every prime
2^4 x 3^2 x 5 = 720
Euclid's algorithm The last non-zero remainder's divisor is the GCF: 12. This needs no factorization at all, which is why it works on numbers far too large to factor.
180 = 3 x 48 + 36 48 = 1 x 36 + 12 36 = 3 x 12 + 0
GCF x LCM = the product True for exactly two numbers and not for three or more. It is how the LCM is computed here, which avoids ever building the product first and overflowing.
12 x 720 = 8,640 = 48 x 180
Reduced ratio Dividing every number by the GCF of 12 gives the simplest whole-number ratio.
4 : 15
The fraction 48/180 reduced Reducing a fraction is the GCF's most common use.
4/15
Adding fractions with these denominators The LCM's most common use. The product of the denominators also works but leaves more reducing to do.
use 720 as the common denominator
  • GCF is also called the greatest common divisor, highest common factor, GCD or HCF. They are all the same thing.
  • Two numbers with a GCF of 1 are called coprime or relatively prime. They need not be prime themselves: 8 and 9 are coprime.

How the GCF and LCM Calculator works

The greatest common factor of two numbers is the largest number dividing both. The least common multiple is the smallest number both divide into. They sound like separate problems and they come out of the same table.

Factor both numbers into primes. 48 = 2^4 x 3 and 180 = 2^2 x 3^2 x 5. Then:

The GCF takes the LOWEST power of each prime that appears in both. The 2s appear to powers 4 and 2, so take 2^2. The 3s appear to powers 1 and 2, so take 3^1. The 5 is missing from 48 entirely, so it cannot be in a common factor. GCF = 4 x 3 = 12.

The LCM takes the HIGHEST power of every prime appearing in either. 2^4 from 48, 3^2 from 180, and 5^1 from 180. LCM = 16 x 9 x 5 = 720.

That symmetry (lowest for the factor, highest for the multiple) is the whole idea, and it explains the identity GCF x LCM = the product of the two numbers. Every prime contributes its lowest power to one side and its highest to the other, so together they account for both numbers exactly: 12 x 720 = 8,640 = 48 x 180. This holds for exactly two numbers and fails for three or more, which is a common trap.

For large numbers, factoring is the wrong method and Euclid's algorithm is the right one. Divide the larger by the smaller and keep the remainder; repeat with the smaller and the remainder until the remainder is zero. The last non-zero remainder is the GCF:

180 = 3 x 48 + 36 48 = 1 x 36 + 12 36 = 3 x 12 + 0

So the GCF is 12, found in three steps without factoring anything. This matters because factorization is hard and Euclid's algorithm is fast. The algorithm is what makes RSA key generation practical, and it will find the GCF of two 300-digit numbers in well under a millisecond while factoring either one would take longer than the universe has existed. The LCM is then the product divided by the GCF, which is also how to compute it without overflowing: divide first, multiply second.

Both have everyday uses that are worth connecting to the arithmetic.

The GCF reduces fractions. 48/180 divided top and bottom by 12 is 4/15, and 12 being the greatest common factor is exactly what guarantees nothing is left to cancel. It also answers tiling and grouping questions: the largest square tile that fills a 48 by 180 inch area without cutting is 12 inches.

The LCM gives common denominators. Adding 1/48 and 1/180 means working in 720ths. It also answers coincidence questions: two events recurring every 48 and 180 days coincide every 720 days, and two gears with 48 and 180 teeth return to their starting alignment after 720 teeth have passed.

One piece of vocabulary. Numbers with a GCF of 1 are coprime, or relatively prime. They do not have to be prime themselves: 8 and 9 share no factor but 1 and neither is prime.

GCF and LCM Calculator FAQ

What is the GCF of 48 and 180?

12. Factor both: 48 = 2^4 x 3 and 180 = 2^2 x 3^2 x 5. Take the lowest power of each shared prime (2^2 and 3^1), giving 4 x 3 = 12. Euclid's algorithm gets there in three steps without factoring.

What is the difference between GCF and LCM?

The GCF is the largest number that divides both, so it is never bigger than either. The LCM is the smallest number both divide into, so it is never smaller than either. From the prime factorizations, the GCF takes the lowest power of each shared prime and the LCM takes the highest power of every prime.

How do I find the LCM quickly?

Multiply the two numbers and divide by their GCF: 48 x 180 / 12 = 720. Divide before multiplying to avoid building a huge intermediate. For three or more numbers, take the LCM of the first two, then the LCM of that with the third, and so on. The product-over-GCF shortcut only works for pairs.

What does it mean for numbers to be coprime?

Their GCF is 1, so they share no factor except 1. They need not be prime themselves: 8 and 9 are coprime, as are 15 and 28. When two numbers are coprime their LCM is simply their product, since there is nothing shared to divide out.

GCF, LCM and least common denominator

Related calculators

Embed this calculator
<div id="compoundpage-gcf-lcm-calculator"></div>
<script src="https://compoundpage.com/embed/gcf-lcm-calculator.js" async></script>

The same calculation as JSON