GCF Calculator

Greatest common factor of two or more numbers — with factor lists and Euclid's steps.

100% FreeNo sign-upPrivate — runs in your browser

Enter whole numbers greater than zero. The gcf calculator lists every factor of each number, so you can see exactly which factors they share and which shared factor is greatest.

—

Greatest common factor

Factor list of each number
—
Common factors
—
Prime factorisations
—
Working (Euclid's method)
—
Check
—
Also: LCM
—
smallest number all of them divide into
Copied to clipboard

How to use this tool

1
Enter your numbers

Type 2 to 6 whole numbers separated by commas into the gcf calculator — for example, 12, 18, 30. Decimals are not allowed here, because factors are defined for whole numbers.

2
Read the factor lists

Every factor of every number is listed, then the factors they all share are pulled out. The greatest common factor is simply the largest one in that shared list.

3
Check the working

The prime factorisations show a second route to the same answer: shared primes at their lowest powers multiply to the GCF. For a pair of numbers, Euclid's division steps are shown too.

4
Verify and copy

Divide each original number by the GCF — if every answer is a whole number, the GCF checks out. Copy the result for homework or a worksheet.

Formula & worked example

GCF(a, b, …) = largest integer d such that d divides every number exactly · By prime factorisation: take each prime shared by all numbers, at its lowest power, and multiply

Worked example: the greatest common factor of 12, 18 and 30 is 6. Factors of 12 are 1, 2, 3, 4, 6, 12; factors of 18 are 1, 2, 3, 6, 9, 18; factors of 30 are 1, 2, 3, 5, 6, 10, 15, 30. The common factors are 1, 2, 3 and 6, and the greatest of them is 6. Check: 12 ÷ 6 = 2, 18 ÷ 6 = 3, 30 ÷ 6 = 5 — all whole numbers. By prime factorisation: 12 = 2² × 3, 18 = 2 × 3², 30 = 2 × 3 × 5, and the shared primes at their lowest powers give 2 × 3 = 6.

Limitations — read this before you rely on it

Factors and the GCF are defined for whole numbers, so this calculator rejects decimals, fractions and negative numbers — convert fractions to whole numbers first if you need their GCF. Very large numbers (above 1,000,000,000) are rejected to keep factor listing fast. The GCF of a set that includes 1 is always 1, which is correct but rarely useful: check you have typed the numbers you meant.

Frequently asked questions

The greatest common factor (GCF, also called GCD or highest common factor) is the largest number that divides every number in a set exactly, with no remainder. For 12, 18 and 30 it is 6. This gcf calculator shows the factor lists so you can see why.

List the factors of each number and pick the largest one they all share — that is exactly what the factor lists above do. For large numbers, Euclid's algorithm is faster: repeatedly replace the larger number by the remainder of dividing it by the smaller one until the remainder is 0; the last non-zero remainder is the GCF. For 12 and 18: 18 = 1 × 12 + 6, then 12 = 2 × 6 + 0, so the GCF is 6.

GCF and GCD are the same thing: greatest common factor = greatest common divisor. HCF (highest common factor) is the same again. Different textbooks just use different names.

Yes — if the GCF is 1, the numbers are called coprime (or relatively prime). For example, 8 and 15 share only the factor 1, so their GCF is 1 even though neither number is prime.

Use the GCF to simplify fractions (divide top and bottom by it), to split things into equal groups with nothing left over, and to find the largest tile or piece size that fits several lengths exactly. The LCM, shown alongside the result, answers the opposite question: the smallest number all of them divide into.