331+ free tools. No sign-up. No hidden fees. Explore the toolkit

GCF Calculator: Greatest Common Factor

The greatest common factor (GCF) — also called the greatest common divisor (GCD) or highest common factor (HCF) — is the largest whole number that divides two or more numbers exactly. It is the key to simplifying fractions and to spotting what numbers have in common.

Enter 2–6 whole numbers, separated by commas or spaces, and this calculator finds their greatest common factor with the Euclidean algorithm, showing the full factor list of each number.

Enter 2–6 whole numbers, separated by commas or spaces. Each number can be up to 1,000,000,000. Negative numbers use their absolute value.

Greatest common factor

Save to Pinterest
Conventions: gcd(0, n) = n, and gcd(0, 0) = 0. Negative numbers are treated by their absolute value. Each input must be a whole number of 1,000,000,000 or less. 0 has no finite factor list, because every whole number divides 0.

How It Works

There are two ways to find a GCF. The direct way is to list the factors of each number and take the largest number that appears on every list. The factors of 48 are 1, 2, 3, 4, 6, 8, 12, 16, 24, 48 and the factors of 36 are 1, 2, 3, 4, 6, 9, 12, 18, 36 — the largest shared factor is 12. That works well for small numbers, and this calculator shows the full factor lists so you can check the answer by eye. A third way is to factor each number into primes first — the shared primes give the GCF.

The faster way is the Euclidean algorithm, known for over two thousand years: divide the larger number by the smaller and keep the remainder, then repeat with the smaller number and the remainder, until the remainder is 0. The last non-zero remainder is the GCF. For 48 and 36: 48 ÷ 36 leaves 12, and 36 ÷ 12 leaves 0, so the GCF is 12. The algorithm is fast even for very large numbers because the remainders shrink quickly.

For three or more numbers, the GCF is built up pair by pair: gcd(a, b, c) = gcd(gcd(a, b), c). So gcd(12, 18, 30) is gcd(6, 30) = 6, because gcd(12, 18) = 6. The GCF is linked to the LCM by a tidy identity: for any two numbers, gcd(a, b) × lcm(a, b) = a × b — for 48 and 36 that is 12 × 144 = 1,728 = 48 × 36.

Worked Example

gcf(48, 36) = 12. By factors: 48 has factors 1, 2, 3, 4, 6, 8, 12, 16, 24, 48 and 36 has factors 1, 2, 3, 4, 6, 9, 12, 18, 36 — the largest number on both lists is 12. By the Euclidean algorithm: 48 ÷ 36 leaves 12, and 36 ÷ 12 leaves 0, so the GCF is 12. Both methods agree.

gcf(12, 18, 30) = 6. First gcd(12, 18) = 6, then gcd(6, 30) = 6, so the GCF of all three is 6. The common factors of 12, 18 and 30 are 1, 2, 3 and 6 — and 6 is the largest.

gcf(17, 23) = 1. 17 and 23 are both prime, so their only factors are 1 and themselves — the only factor they share is 1. Numbers with a GCF of 1 are called coprime.

Assumptions

Sources: No external data is used on this page — every figure is calculated from the numbers you enter, using the standard Euclidean algorithm and complete factor lists. Last reviewed: 15 November 2026.

Built and tested by SumKitTool — see how we check our numbers.

How to Use This Calculator

Type your numbers into the box, separated by commas or spaces — for example "48, 36" or "12 18 30" — and the result appears as you type. The table shows the factor list of each number and the Euclidean steps, so you can verify the answer two ways. Reset restores the example 48, 36.

Try the worked examples: "12, 18, 30" gives 6, and "17, 23" gives 1 with a note that the numbers are coprime. To see the zero convention, try "0, 36" — the answer is 36, because every number divides 0.

Tips and Practical Advice

The GCF is the tool for simplifying fractions: divide the top and bottom by their GCF. 36/48 simplifies by dividing both by 12, giving 3/4. If the GCF is 1, the fraction is already in its simplest form.

The GCF never exceeds your smallest input — it has to divide that number, after all. And if one number divides another exactly, the GCF is the smaller number: gcf(6, 12) = 6, because 6 divides 12.

When the GCF is 1, the numbers are coprime — they share no factor at all. Coprime pairs turn up in cryptography, in gear ratios (teeth counts that are coprime wear evenly) and in music, where coprime rhythms only line up after a full cycle.

Frequently Asked Questions

How do you find the GCF of two numbers?

Use the Euclidean algorithm: divide the larger by the smaller and keep the remainder, then repeat with the smaller number and the remainder until the remainder is 0 — the last non-zero remainder is the GCF. For 48 and 36: 48 ÷ 36 leaves 12, and 36 ÷ 12 leaves 0, so the GCF is 12. Listing factors works too: the largest number on both factor lists is the GCF.

What is gcd(0, n)?

It is n. Every number divides 0, so the greatest common divisor of 0 and n is n itself. If every number is 0, the GCF is 0 by convention. Note that 0 has no finite factor list, because every whole number divides it.

What does a GCF of 1 mean?

It means the numbers are coprime — they share no factor bigger than 1. For example gcf(17, 23) = 1, because 17 and 23 are both prime. A fraction whose top and bottom have a GCF of 1 is already in its simplest form.

Is GCF the same as GCD and HCF?

Yes. GCF (greatest common factor), GCD (greatest common divisor) and HCF (highest common factor) are three names for the same number. GCD is the most common name in textbooks; HCF is used in the UK and India; this calculator uses GCF.

Last updated: