GCD & LCM Calculator

Euclidean algorithm — step by step

    Find the greatest common divisor (GCD) and least common multiple (LCM) of two numbers, with the Euclidean algorithm shown step by step and the prime factorization of each number. Free and instant for homework and revision.

    Frequently asked questions

    What is the GCD?

    The greatest common divisor is the largest whole number that divides both numbers exactly. For 48 and 18, the GCD is 6.

    What is the LCM?

    The least common multiple is the smallest number that is a multiple of both numbers. For 4 and 6, the LCM is 12.

    How does the Euclidean algorithm work?

    Divide the larger number by the smaller, replace the larger with the remainder, and repeat until the remainder is 0. The last non-zero remainder is the GCD.

    How are GCD and LCM related?

    For any two numbers, GCD × LCM equals the product of the two numbers. This calculator shows that check with your numbers.