cscgd

GCF Calculator

Enter two or more whole numbers to find their greatest common factor (GCF), also called the greatest common divisor (GCD) or highest common factor (HCF). The calculator shows the Euclidean algorithm step by step, the prime factorisation of each number, all common factors, and the least common multiple as a bonus.

GCF calculator

Euclidean algorithm

    Prime factorisation

    Factors & Multiples Practice Pack

    Printable GCF and LCM worksheets with answer keys, a factor tree template, a prime numbers chart to 200 and a fractions simplifying worksheet.

    Formats: PDF, DOCX. Instant download after payment (link valid 72 hours, up to 5 downloads). AI-assisted: the templates were drafted with AI help and reviewed and laid out by Kedop.

    $3.00 USD, one-time

    Secure card checkout by Stripe. Full refund within 7 days — see the refund policy and license.

    What the greatest common factor is

    The greatest common factor (GCF) of two or more whole numbers is the largest number that divides all of them exactly. For 84, 126 and 210 it is 42: 84 = 42 × 2, 126 = 42 × 3 and 210 = 42 × 5, and no larger number divides all three. The same idea is called the greatest common divisor (GCD) in higher mathematics and computing, and the highest common factor (HCF) in the UK and elsewhere.

    Three ways to find the GCF

    MethodHow it worksBest for
    Listing factorsList all factors of each number and pick the largest shared oneSmall numbers
    Prime factorisationBreak each number into primes; multiply the primes they share, using the lowest powerUnderstanding why; also gives the LCM
    Euclidean algorithmRepeatedly replace the larger number with the remainder of dividing by the smallerLarge numbers; fastest

    The Euclidean algorithm, step by step

    To find GCF(126, 84): divide 126 by 84 — quotient 1, remainder 42. Now find GCF(84, 42): 84 ÷ 42 = 2 remainder 0. When the remainder reaches zero, the last non-zero remainder, 42, is the GCF. The method works because any number that divides both 126 and 84 also divides their difference and remainders. It is over two thousand years old — it appears in Euclid’s Elements — and is still used in computers today because it is extremely fast even for huge numbers.

    Using prime factorisation

    Write each number as a product of primes: 84 = 2² × 3 × 7, 126 = 2 × 3² × 7 and 210 = 2 × 3 × 5 × 7. The GCF takes each prime that appears in every number, with its lowest power: 2¹ × 3¹ × 7¹ = 42. The least common multiple (LCM) takes every prime with its highest power: 2² × 3² × 5 × 7 = 1,260. The calculator shows the factorisation of each number and of the GCF.

    Where the GCF is used

    GCF vs LCM

    The GCF is the largest number that divides into all the numbers; the LCM is the smallest number that all the numbers divide into. For two numbers, GCF × LCM = the product of the numbers: GCF(12, 18) × LCM(12, 18) = 6 × 36 = 216 = 12 × 18. Use the GCF to simplify, and the LCM to find common denominators and to line up repeating events.

    Worked example

    A teacher has 84 pencils, 126 erasers and 210 stickers and wants to make identical gift packs with nothing left over. The GCF of 84, 126 and 210 is 42, so she can make 42 packs, each with 2 pencils, 3 erasers and 5 stickers. The calculator shows the Euclidean steps — GCF(84, 126) = 42, then GCF(42, 210) = 42 — and the simplified ratio 2 : 3 : 5.

    Special cases

    Listing factors for small numbers

    For small numbers, listing factors is quick and builds number sense. Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24. Factors of 36: 1, 2, 3, 4, 6, 9, 12, 18, 36. The common factors are 1, 2, 3, 4, 6 and 12, so the GCF is 12. Find factors in pairs — 1 × 24, 2 × 12, 3 × 8, 4 × 6 — and stop when the pairs meet in the middle, so none are missed. The calculator lists all the common factors of your numbers, which are simply the factors of the GCF.

    The GCF in algebra

    Factoring out the greatest common factor is the first step in factoring any polynomial. For 18x³ + 27x², the GCF of the coefficients 18 and 27 is 9, and the lowest power of x shared by both terms is x², so the expression factors as 9x²(2x + 3). Always check for a common factor before trying other factoring methods; it makes the remaining expression smaller and easier to work with.

    Teaching tips

    Privacy

    All calculations run in your browser; nothing is stored or uploaded.

    Frequently asked questions

    What is the GCF of 12 and 18?

    6.

    Is GCF the same as GCD and HCF?

    Yes — greatest common factor, greatest common divisor and highest common factor are the same thing.

    How do I find the GCF of three numbers?

    Find the GCF of the first two, then the GCF of that result and the third number.

    What does relatively prime mean?

    The numbers have no common factor other than 1.

    How is the GCF used with fractions?

    Divide the top and bottom by the GCF to simplify the fraction.

    Is my data stored?

    No, it runs in your browser.