All calculators

Education

GCF Calculator

Enter two or more positive whole numbers. The calculator returns their greatest common factor, the factor list for each number, and the Euclidean steps that produce the answer.

Two or more positive whole numbers, comma- or space-separated. · e.g. 48, 60, 84

The GCF (greatest common factor) is the largest whole number that divides every input evenly.

Euclidean steps

  1. gcd(48, 60) = 12
Greatest common factor

GCF

12

gcf(48, 60)

Numbers48, 60
GCF12
Factors of 481, 2, 3, 4, 6, 8, 12, 16, 24, 48
Factors of 601, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60

The Euclidean algorithm finds gcd(a, b) by repeated remainders: replace (a, b) with (b, a mod b) until the second number is 0. Then the GCF of the full list is the GCF of (running result, next number) folded across the list.

Was this helpful?

Examples

GCF of 48 and 60

= 12

GCF of 12, 18, 30

= 6

GCF of 17 and 5

= 1 (coprime)

How it works

The greatest common factor of two numbers a and b can be found by the Euclidean algorithm: repeatedly replace the pair (a, b) with (b, a mod b) until the second number is zero. The first number is then the GCF. For more than two inputs, the calculator folds gcf across the list.

Recurrence · gcf(a, b) = gcf(b, a mod b), gcf(a, 0) = a

More numbers · gcf(a, b, c) = gcf(gcf(a, b), c)

All inputs must be positive whole numbers.

Related math calculators

Frequently asked questions

The greatest common factor (GCF) of two or more whole numbers is the largest number that divides every one of them with no remainder. It is also called the greatest common divisor (GCD) or highest common factor (HCF). For 48 and 60, the GCF is 12, because 12 divides both 48 and 60 evenly and no larger number does.

The fastest method is the Euclidean algorithm: replace the pair (a, b) with (b, a mod b) repeatedly until the second number becomes 0. The first number at that point is the GCF. For three or more numbers, fold the algorithm: gcf(a, b, c) = gcf(gcf(a, b), c). This calculator uses that approach and shows the steps.

GCF is the largest number that divides all inputs; LCM is the smallest number that all inputs divide into. For 4 and 6: GCF is 2 (largest divisor of both), LCM is 12 (smallest multiple of both). They are connected by the rule lcm(a, b) = (a × b) ÷ gcf(a, b).

Simplifying fractions (divide numerator and denominator by their GCF to reduce to lowest terms), splitting items into equal groups, and number-theory problems. The GCF tells you the size of the largest evenly-shared piece.

Yes. Separate the numbers with commas or spaces, for example '48, 60, 84'. The calculator folds the Euclidean algorithm across the full list.

By convention gcd(n, 0) = n for any positive n, but in everyday math GCF is computed for positive whole numbers. This calculator requires every input to be a positive whole number to avoid confusing edge cases.