About the GCF Calculator
The greatest common factor of two numbers is the largest number that divides both of them exactly. For 48 and 18 it is 6: both divide by 6, and nothing larger works for both.
You will meet the same idea under three names. GCF — greatest common factor — is usual in American schools. HCF, highest common factor, is the British term. GCD, greatest common divisor, is what mathematicians and programmers say. All three are the same number.
There are two classical ways to find it, and they are worth knowing for different reasons. Prime factorisation shows why the answer is what it is. The Euclidean algorithm is dramatically faster and explains nothing. This calculator shows both, side by side, so you can see the tradeoff.
How to Use the GCF Calculator
Enter two or more whole numbers, separated by commas, spaces or new lines. A column pasted from a spreadsheet works directly.
Press Calculate. You get the greatest common factor, the prime factorisation of each input, and the full list of divisors the numbers share.
Negative numbers are accepted and treated by magnitude, since −48 and 48 have the same divisors. Decimals are refused, because factors are defined for whole numbers only.
A zero among your numbers is fine: every number divides zero, so the GCF is whatever the other numbers give. A list of nothing but zeros has no answer, and the calculator says so rather than returning something arbitrary.
How the GCF Is Calculated
By prime factorisation. Break each number into primes, then take every prime they all share, each at its lowest power.
48 = 2^4 x 3
18 = 2 x 3^2
Both contain a 2 and a 3. The lowest power of 2 present in both is 2¹, and the lowest power of 3 is 3¹. So the GCF is 2 × 3 = 6.
The logic is direct: any common divisor can only be built from primes that appear in both, and it cannot use more copies of a prime than the number with fewer has. Taking the lowest power of every shared prime gives the largest such divisor.
By the Euclidean algorithm. Divide the larger by the smaller and keep the remainder. Then repeat with the smaller number and that remainder. When the remainder hits zero, the last non-zero value is the answer.
48 = 2 x 18 + 12
18 = 1 x 12 + 6
12 = 2 x 6 + 0
The last non-zero remainder is 6. No factorisation anywhere.
It works because any number dividing both a and b must also divide their remainder — so the pair can be replaced by a smaller pair without changing the answer. Each step shrinks the numbers quickly, and the process cannot run forever.
For more than two numbers, take the GCF of the first two, then of that result and the third, and so on. The operation is associative, so the order does not matter.
GCF Formula
gcd(a, b) = gcd(b, a mod b), with gcd(a, 0) = a
gcd(a, b, c) = gcd( gcd(a, b), c )
By factorisation:
GCF = product over shared primes of p^min(power in a, power in b)
Relationship with the LCM (two numbers only):
gcd(a, b) x lcm(a, b) = a x b
That last identity is genuinely useful: find one and you have the other for free. It does not extend to three or more numbers — gcd × lcm of three values is not their product.
Step-by-Step Example
Find the GCF of 48, 180 and 210.
By factorisation:
48 = 2^4 x 3
180 = 2^2 x 3^2 x 5
210 = 2 x 3 x 5 x 7
Which primes appear in all three? Only 2 and 3. The lowest power of 2 anywhere is 2¹ (in 210); the lowest power of 3 is 3¹. So:
GCF = 2 x 3 = 6
Note that 5 appears in two of them and is therefore excluded — a common factor must be common to all.
By Euclid, taking them in pairs:
gcd(48, 180):
180 = 3 x 48 + 36
48 = 1 x 36 + 12
36 = 3 x 12 + 0 -> 12
gcd(12, 210):
210 = 17 x 12 + 6
12 = 2 x 6 + 0 -> 6
Same answer, five short divisions, no factorising.
Check. 48 ÷ 6 = 8, 180 ÷ 6 = 30, 210 ÷ 6 = 35. All whole. And 8, 30 and 35 share no further common factor, confirming 6 could not be larger.
Understanding Your Result
The greatest common factor is the headline.
The prime factorisations show where it came from. Line them up and the shared primes are visible at a glance — this is the part worth reading if you are learning the method rather than just needing the number.
The common divisors list every number that divides all your inputs. The GCF is simply the largest of them, and the list always begins at 1. A useful property: every common divisor divides the GCF, so the list is exactly the divisors of the GCF itself.
A result of 1 means the numbers are coprime — they share no factor at all. This is not a failure; it is often the informative answer. A fraction whose numerator and denominator are coprime is already in lowest terms.
Note that the numbers need not be prime to be coprime. 8 and 9 share nothing, and neither is prime.
When Should You Use This Calculator?
Simplifying fractions. Divide the numerator and denominator by their GCF and the fraction reaches lowest terms in a single step.
Dividing things into equal groups. The largest group size that splits several quantities evenly is their GCF. Cutting 48 cm and 180 cm of ribbon into equal pieces with none left over means pieces of 12 cm — or 6 cm if a third length of 210 cm joins in.
Tiling and layout. The largest square tile that fits a rectangular area without cutting is the GCF of the side lengths.
Ratios. Reducing a ratio to simplest form means dividing every term by their GCF.
Algebra. Factoring out the greatest common factor is the first step in most factorisation problems.
Scheduling. Where the LCM answers "when do these coincide", the GCF answers "what is the largest interval that fits all of them evenly".
Common Mistakes
Confusing the GCF with the LCM. The GCF is the largest number that divides into them and is never bigger than the smallest input. The LCM is the smallest number they divide into and is never smaller than the largest input. If your "GCF" exceeds one of the numbers, you found the LCM.
Taking the highest power instead of the lowest. For the GCF you want the lowest power of each shared prime. Taking the highest gives the LCM.
Including a prime that is not in every number. In the example above, 5 appears in 180 and 210 but not 48, so it cannot be part of the GCF. Common means common to all.
Stopping the Euclidean algorithm too early. Continue until the remainder is exactly zero. The answer is the last non-zero remainder, not the last one you computed.
Assuming coprime means prime. 8 and 9 are coprime and neither is prime. Coprimality is about what they share, not about what they are.
Applying gcd × lcm = product to three numbers. The identity holds for pairs only.
Trying to factorise very large numbers. Beyond a certain size, factorisation becomes impractical while Euclid remains instant. That gap is not an inconvenience — it is the foundation that RSA encryption rests on.