GCF Calculator

Greatest common factor (GCD) of two or more whole numbers, with each number's prime factorization.

Two or more whole numbers, separated by commas or spaces

Greatest common factor

6

12
2^2 × 3
18
2 × 3^2
24
2^3 × 3
GCF factorization
2 × 3
Relatively prime?
No

How it works

The greatest common factor (GCF), also called the greatest common divisor (GCD), is the largest whole number that divides every number in the list with no remainder. For 12, 18 and 24 it is 6.

It is found with the Euclidean algorithm: repeatedly replace the larger number by its remainder when divided by the smaller, until the remainder is zero. The prime factorizations are shown too: the GCF is the product of the primes they all share, at the lowest power.

Formula

gcd(a, b) = gcd(b, a mod b), gcd(a, 0) = a; gcd(a, b, c) = gcd(gcd(a, b), c)

Questions people ask

What is the GCF used for?

Simplifying fractions (divide top and bottom by the GCF), factoring expressions, and splitting things into the largest equal groups, like cutting 12 and 18 ft boards into equal 6 ft pieces.

What does it mean if the GCF is 1?

The numbers are relatively prime (coprime): they share no factor other than 1, like 8 and 15.

How are GCF and LCM related?

For two numbers, GCF × LCM = a × b. For 12 and 18: 6 × 36 = 216 = 12 × 18.