Toolvist

GCF Calculator

Find the greatest common factor of a set of numbers using Euclid's algorithm, with every step shown.

Separate with commas, spaces or new lines.

Greatest common factor

—

Least common multiple

—

Common divisors

—

Numbers

0

Coprime?

—

Euclid\'s algorithm

    Prime factorisation

    All common divisors

    GCF Calculator

    Find the greatest common factor of a set of numbers, also called the greatest common divisor or highest common factor. Every step of Euclid's algorithm is shown, along with the prime factorisation and the complete list of shared divisors.

    The companion is the LCM Calculator, and both feed the Fraction Calculator when simplifying. For the statistical spread of a set of numbers rather than their common factors, the Standard Deviation Calculator is the tool.

    How to use the GCF

    1. 1 Enter two or more whole numbers.
    2. 2 The greatest common factor is found using Euclid's algorithm, with each step shown.
    3. 3 Read the final divisor, which is the answer.
    4. 4 Check the steps to see the remainders being reduced.

    Why the algorithm terminates

    Each step produces a strictly smaller remainder, and a sequence of strictly decreasing non-negative integers cannot continue indefinitely. It must eventually reach zero. That guarantee is what makes the algorithm reliable rather than merely usually correct, and it is the property that makes it efficient even on very large numbers.

    The efficiency matters in practice. Euclid's algorithm finds the common factor of two enormous numbers in a number of steps proportional to the number of digits rather than to the size of the numbers themselves, which is why it underlies arithmetic in cryptographic systems.

    • GCF of coprime numbers is 1.
    • GCF times LCM equals the product, for two numbers.
    • Dividing both terms of a fraction by their GCF reduces it fully.
    • The algorithm works for any pair of integers, not just small ones.

    Three ways to find it

    Listing factors works for small numbers. Prime factorisation takes the lowest power of each shared prime. Euclid's algorithm is the fastest: it repeatedly replaces the larger number with the remainder of dividing by the smaller, until the remainder is zero. All three agree, and this tool shows the first two plus the full trace of the third.

    Frequently asked questions

    How does Euclid's algorithm work?

    By repeatedly replacing the larger number with the remainder of dividing it by the smaller. Because the remainder is always smaller than the divisor, the numbers shrink every round, and when the remainder reaches zero the last divisor is the answer. It terminates quickly, which is why it has been the standard method for over two thousand years.

    Why is the GCF also called the GCD?

    The terms are interchangeable in ordinary use. Greatest common factor and greatest common divisor describe the same number. The divisor phrasing is more common in formal mathematics and the factor phrasing in school teaching, but no distinction is intended.

    What is the GCF used for?

    Most directly for simplifying fractions, where both numerator and denominator are divided by their GCF. It also applies to factoring algebraic expressions, to tiling problems where you need the largest square that divides a rectangle evenly, and to any problem asking what the largest shared unit is.

    Related Calculators

    Browse all Calculators →

    You might also need

    Tools from other categories that people pair with the GCF:

    Browse the full tool directory →