CalculateFractions.com, home page

LCM and GCF calculator

Type two or three whole numbers. You get the greatest common factor (GCF) and the least common multiple (LCM), worked out with prime factors.

Separate the numbers with a space or a comma: 24 36

How you write it in your notebook

Type the numbers or tap an example:

Answer

Step-by-step solution

    Type the numbers or tap an example:

    Greatest common factor

    The GCF is the largest number that divides all the given numbers with no remainder. It is also called the greatest common divisor (GCD) or highest common factor (HCF). You need it to simplify fractions.

    Write each number as a product of primes and multiply the primes they share.

    24 = 2 × 2 × 2 × 3
    36 = 2 × 2 × 3 × 3

    Both contain 2, 2 and 3, so GCF(24, 36) = 2 × 2 × 3 = 12.

    Least common multiple

    The LCM is the smallest number that all the given numbers divide into. When you add fractions, the LCM of the denominators is the least common denominator.

    Start with the prime factors of the largest number and add any factors it is missing from the others. 36 = 2 × 2 × 3 × 3 is missing one more 2 from 24, so LCM(24, 36) = 36 × 2 = 72.

    For small numbers, listing multiples is often quicker: the multiples of 6 are 6, 12, 18, 24, and the first one that 8 divides is 24, so LCM(6, 8) = 24.

    A shortcut for two numbers

    LCM(a, b) = a × b ÷ GCF(a, b)

    For 24 and 36: 864 ÷ 12 = 72. This also works as a check, since GCF × LCM always equals the product of the two numbers.

    Large numbers: the Euclidean algorithm

    Factoring big numbers is slow. Instead, divide the larger number by the smaller one, then divide the smaller one by the remainder, and keep going until the remainder is 0. The last divisor is the GCF. The calculator switches to this method on its own when the numbers are large.

    Relatively prime numbers

    When the GCF is 1, as with 9 and 14, the numbers are called relatively prime (or coprime). Their LCM is simply their product, 126.

    Examples

    Questions people ask

    What is the difference between LCM and GCF?

    The GCF is the biggest number that divides into all of them. The LCM is the smallest number all of them divide into. For 4 and 6, the GCF is 2 and the LCM is 12.

    How do you find the LCM of two numbers?

    Multiply the numbers and divide by their GCF, or list multiples of the larger number until you reach one the smaller number divides.

    Is GCF the same as GCD?

    Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number.

    What is the LCM of 3, 4 and 6?

    12. It is the smallest number that 3, 4 and 6 all divide evenly.

    Why do I need the LCM for fractions?

    The LCM of the denominators is the least common denominator, the smallest denominator you can use to add or subtract the fractions.