GCF and LCM Calculator

Type two or more whole numbers separated by commas or spaces. The greatest common factor and least common multiple appear instantly, with each step shown.

Enter 2 to 10 whole numbers from 1 to 1,000,000,000,000, separated by commas or spaces.

GCF–
LCM–
Step by step

    What are the GCF and LCM?

    The greatest common factor (GCF) – also called the greatest common divisor (GCD) or highest common factor (HCF) – is the largest number that divides all the numbers without a remainder. The least common multiple (LCM) is the smallest number that all of them divide into.

    Example: for 12 and 18, the GCF is 6 and the LCM is 36.

    How to find them with prime factors

    1. Split each number into prime factors: 12 = 2² × 3 and 18 = 2 × 3².
    2. For the GCF, take the primes they share with the lowest power: 2 × 3 = 6.
    3. For the LCM, take every prime with the highest power: 2² × 3² = 36.

    For two numbers there is a handy check: GCF × LCM = a × b, so 6 × 36 = 12 × 18 = 216.

    Where you use GCF and LCM

    • Simplifying fractions: divide the top and bottom by their GCF (18/24 → 3/4).
    • Adding fractions: the LCM of the denominators is the lowest common denominator.
    • Everyday problems: when two buses that leave every 12 and 18 minutes meet again (after 36 minutes, the LCM), or how to cut pieces into equal groups (GCF).

    Frequently asked questions

    What is the difference between GCF and GCD?

    None – greatest common factor (GCF), greatest common divisor (GCD) and highest common factor (HCF) are three names for the same thing.

    What if the GCF is 1?

    Then the numbers are called coprime (or relatively prime). Their LCM is then simply their product, for example 8 and 15 → LCM 120.

    How big can the numbers be?

    Each number can be up to 1,000,000,000,000 (one trillion), and you can enter up to 10 numbers. The LCM is calculated exactly, even when it gets very large.

    Can I use negative numbers or zero?

    No. The calculator works with positive whole numbers from 1 upwards. For negative numbers, use their positive value – the GCF and LCM are the same.

    Related tools