GCF Calculator
Find the greatest common factor of two or more whole numbers. Enter numbers separated by commas, spaces, or new lines.
Results
A GCF Calculator finds the largest positive integer that divides every entered whole number without leaving a remainder.
GCF stands for:
greatest common factor
The same value is also commonly called the:
greatest common divisor (GCD)
The GCF is useful for reducing fractions, forming equal groups, simplifying ratios, and identifying common numerical factors in algebra.
Enter two or more integers and find the largest positive number that divides every value exactly.
What greatest common factor means
Consider:
18 and 24
The positive factors of 18 are:
1, 2, 3, 6, 9, 18
The positive factors of 24 are:
1, 2, 3, 4, 6, 8, 12, 24
Their common factors are:
1, 2, 3, and 6
The largest is:
6
Therefore:
GCF(18, 24) = 6
How to use the GCF Calculator
- Enter two or more whole numbers.
- Separate the numbers in the format requested by the calculator.
- Include negative integers if needed; their absolute values determine the positive GCF.
- Calculate the result.
- Divide each original number by the GCF to verify that every quotient is an integer.
Do not round decimal values into integers merely to use the calculator.
GCF and GCD mean the same thing
The terms:
greatest common factor
and:
greatest common divisor
refer to the same positive integer.
For example:
GCF(20, 30) = 10
and:
GCD(20, 30) = 10
Different textbooks, calculators, and programming languages may prefer one term over the other.
Three common ways to find a GCF
A greatest common factor can be found using:
| Method | Most useful when |
|---|---|
| Listing factors | Numbers are small |
| Prime factorization | You want to see shared prime factors |
| Euclidean algorithm | Numbers are large or factor lists would be long |
All three methods should produce the same result.
Method 1: listing factors
For small values, list all positive factors.
Consider:
12 and 18
Factors of 12:
1, 2, 3, 4, 6, 12
Factors of 18:
1, 2, 3, 6, 9, 18
Common factors:
1, 2, 3, 6
The greatest is:
6
So:
GCF(12, 18) = 6
This method is easy to understand but becomes inconvenient for large numbers.
Method 2: prime factorization
Every positive integer greater than 1 can be expressed as a product of prime numbers.
Consider:
72 and 120
Prime factorize 72:
72 = 2³ × 3²
Prime factorize 120:
120 = 2³ × 3 × 5
Now select only the prime factors shared by both numbers.
For:
2
the smaller exponent is:
3
For:
3
the smaller exponent is:
1
The factor:
5
does not appear in both numbers.
So:
GCF = 2³ × 3
= 8 × 3
= 24
Therefore:
GCF(72, 120) = 24
Use the lowest shared exponent
This is an important rule.
When finding the GCF through prime factorization, use the lowest exponent of each prime that appears in every number.
For example:
48 = 2⁴ × 3
and:
72 = 2³ × 3²
For the common prime:
2
choose:
2³
not:
2⁴
For:
3
choose:
3¹
So:
GCF = 2³ × 3 = 24
Choosing the highest exponents would lead toward the LCM calculation instead.
Method 3: Euclid’s algorithm
The Euclidean algorithm finds the GCF without listing all factors or fully prime-factorizing the numbers.
Start with two positive integers.
Divide the larger by the smaller and record the remainder.
Then replace the larger number with the smaller number and the smaller number with the remainder.
Continue until the remainder becomes zero.
The last nonzero remainder is the GCF.
Euclidean algorithm example
Find:
GCF(252, 105)
Divide:
252 ÷ 105 = 2 remainder 42
So:
252 = 105 × 2 + 42
Now use:
105 and 42
Divide:
105 ÷ 42 = 2 remainder 21
So:
105 = 42 × 2 + 21
Now use:
42 and 21
Divide:
42 ÷ 21 = 2 remainder 0
The last nonzero remainder is:
21
Therefore:
GCF(252, 105) = 21
Why Euclid’s algorithm works well for large numbers
Suppose the inputs are:
12,345
and:
6,789
Listing every factor would be tedious.
Prime factorization could also require significant work.
The Euclidean algorithm repeatedly reduces the size of the problem through remainders.
That often makes it the most efficient hand method for large integers.
The calculator can perform the process automatically.
Finding the GCF of more than two numbers
The GCF can be calculated for any finite list of integers.
For example:
36, 60, and 84
First find:
GCF(36, 60)
The result is:
12
Then find:
GCF(12, 84)
which is:
12
Therefore:
GCF(36, 60, 84) = 12
A factor must divide every number in the list to remain part of the final GCF.
Why checking only two numbers can fail
Consider:
24, 36, and 50
First:
GCF(24, 36) = 12
But:
12
does not divide:
50
So 12 is not the GCF of all three numbers.
Continue:
GCF(12, 50) = 2
Therefore:
GCF(24, 36, 50) = 2
Every entered value must be included.
Negative numbers use absolute values
The GCF is normally reported as a positive integer.
For example:
GCF(−18, 24)
uses:
18 and 24
So:
GCF(−18, 24) = 6
Likewise:
GCF(−20, −30) = 10
The negative signs do not make the final GCF negative.
The GCF itself is not reported as negative
Even when all inputs are negative:
GCF(−12, −18)
is:
6
not:
−6
The standard GCF is the greatest positive common divisor.
Zero needs special treatment
Zero behaves differently from ordinary nonzero integers.
For a nonzero integer:
a
the usual convention is:
GCF(a, 0) = |a|
For example:
GCF(15, 0) = 15
because every positive divisor of 15 also divides zero, and the largest one is 15.
What about GCF(0, 0)?
The pair:
GCF(0, 0)
is a special case.
In elementary mathematics it is commonly treated as undefined because every positive integer divides zero, so there is no largest positive common divisor.
Some mathematical or software conventions define this case differently.
For ordinary calculator use, do not assume:
GCF(0, 0)
has a standard positive result unless the tool explicitly states its convention.
Coprime numbers have GCF 1
Two or more integers are called:
coprime
or:
relatively prime
when their greatest common factor is:
1
For example:
8 and 15
Factors of 8:
1, 2, 4, 8
Factors of 15:
1, 3, 5, 15
The only common positive factor is:
1
Therefore:
GCF(8, 15) = 1
The numbers do not need to be prime themselves to be coprime with each other.
One number can be the GCF
Suppose:
12 and 36
Because:
12
divides:
36
exactly, the smaller number is already a common factor of both.
So:
GCF(12, 36) = 12
This happens whenever one entered number divides all the others exactly.
Equal numbers have that same number as their GCF
For example:
GCF(25, 25) = 25
Likewise:
GCF(14, 14, 14) = 14
Every number divides itself, so when all positive inputs are equal, that value is the GCF.
Use the GCF to simplify fractions
One of the most common uses of the GCF is reducing fractions.
Consider:
84/126
Find:
GCF(84, 126)
The result is:
42
Divide numerator and denominator by 42:
84 ÷ 42 = 2
126 ÷ 42 = 3
Therefore:
84/126 = 2/3
Using the greatest common factor removes every shared numerical factor in one step.
Smaller cancellations also work, but take longer
You could simplify:
84/126
by repeatedly dividing by smaller common factors.
For example:
84/126 ÷ 2/2 = 42/63
Then divide by 3:
42/63 = 14/21
Then divide by 7:
14/21 = 2/3
This is valid.
But using:
GCF = 42
reaches:
2/3
immediately.
It also reduces the chance of stopping before the fraction is fully simplified.
Use GCF to simplify ratios
Consider:
48:72
Find:
GCF(48, 72) = 24
Divide both terms:
48 ÷ 24 = 2
72 ÷ 24 = 3
Therefore:
48:72 = 2:3
This is the same principle used to reduce fractions.
Use the Ratio Calculator when the full task involves scaling, equivalent ratios, or dividing a total.
GCF can solve equal-group problems
Suppose you have:
48 red tiles
and:
60 blue tiles
You want to create the greatest possible number of identical groups with:
- no tiles left over;
- the same number of red tiles in every group;
- and the same number of blue tiles in every group.
Find:
GCF(48, 60)
The result is:
12
So the largest number of identical groups is:
12
Each group contains:
48 ÷ 12 = 4 red tiles
and:
60 ÷ 12 = 5 blue tiles
The GCF answers the number of equal groups
In the grouping example:
GCF = 12
answers:
How many identical groups can be made at most?
The quotients:
4 and 5
answer:
What does each group contain?
These are related but different pieces of information.
GCF can identify the largest equal segment
Suppose you have two lengths:
36 cm
and:
48 cm
and want to cut both into equal whole-number-length pieces with no waste.
Find:
GCF(36, 48) = 12
So the largest possible equal piece length is:
12 cm
The first length gives:
36 ÷ 12 = 3 pieces
The second gives:
48 ÷ 12 = 4 pieces
GCF and LCM answer opposite-style questions
The GCF finds the largest number that divides all inputs.
The LCM finds the smallest positive number that all inputs divide into evenly.
For:
12 and 18
GCF = 6
while:
LCM = 36
A useful distinction is:
GCF → common divisor
LCM → common multiple
Use the LCM Calculator when you need the smallest shared multiple.
Prime factorization shows the difference between GCF and LCM
Consider:
12 = 2² × 3
and:
18 = 2 × 3²
For the GCF, choose the lowest shared exponents:
2¹ × 3¹ = 6
For the LCM, choose the highest exponents needed:
2² × 3² = 36
Confusing these exponent rules is a common source of mistakes.
A useful relationship between GCF and LCM
For two nonzero integers:
GCF(a, b) × LCM(a, b) = |a × b|
For example:
a = 12
b = 18
Then:
GCF = 6
and:
LCM = 36
So:
6 × 36 = 216
and:
12 × 18 = 216
The relationship checks correctly.
This identity applies to a pair of nonzero integers.
GCF in algebra
The GCF can also help factor algebraic expressions.
Consider:
12x + 18
The numerical coefficients:
12 and 18
have:
GCF = 6
So:
12x + 18 = 6(2x + 3)
But algebraic factoring can also involve variable powers.
A numeric GCF Calculator handles the integer coefficients only unless it specifically supports algebraic expressions.
Variables have their own common factors
Consider:
12x³ + 18x²
The numerical GCF is:
6
The common variable factor is:
x²
So the full algebraic GCF is:
6x²
and:
12x³ + 18x² = 6x²(2x + 3)
A numerical GCF Calculator can provide the:
6
but it cannot necessarily identify:
x²
unless algebraic input is supported.
Decimals are not ordinary integer inputs
The standard GCF is defined for integers.
For example:
12.5
is not an integer.
The calculator should not silently turn:
12.5
into:
13
or:
12
That would change the value.
If decimal quantities represent measurements, another mathematical setup may be needed.
Decimals can sometimes be scaled intentionally
Suppose you want to compare:
1.2
and:
1.8
If the context permits multiplying both by:
10
you obtain:
12 and 18
whose GCF is:
6
The original common unit step would then correspond to:
0.6
But this is not the same as saying the ordinary integer GCF of 1.2 and 1.8 is automatically defined as 0.6.
Scaling decimals is a separate modeling choice and should be handled explicitly.
Fractions should not be entered as integers
Likewise:
3/4
and:
5/8
are rational numbers rather than integers.
Do not remove the fraction bars and enter:
34
and:
58
The GCF of those digit strings would answer an unrelated question.
If the goal involves fractions, first identify what quantity you actually need to simplify or compare.
How to verify a GCF result
Suppose the calculator reports:
GCF(54, 90) = 18
Check:
54 ÷ 18 = 3
and:
90 ÷ 18 = 5
Both quotients are whole numbers.
So 18 divides both values.
You can also check that no larger common factor exists.
Prime factorization gives another independent verification.
Verification by prime factorization
For:
54
54 = 2 × 3³
For:
90
90 = 2 × 3² × 5
Shared primes with the lowest exponents are:
2 × 3²
So:
2 × 9 = 18
This confirms:
GCF(54, 90) = 18
Verification for multiple values
Suppose the result is:
GCF(36, 60, 84) = 12
Check:
36 ÷ 12 = 3
60 ÷ 12 = 5
84 ÷ 12 = 7
Every quotient is an integer.
So 12 divides every value.
If even one quotient were not whole, the proposed GCF would be incorrect.
Common mistakes to avoid
Confusing GCF with LCM
The GCF is a shared divisor, not a shared multiple.
Choosing the highest prime exponents
For GCF, use the lowest exponent shared by every number.
Checking only two values in a longer list
The final factor must divide every input.
Reporting a negative GCF
The conventional GCF is positive.
Ignoring zero conventions
GCF(a,0) requires special handling, and GCF(0,0) is generally not treated like an ordinary input pair.
Rounding decimal inputs
GCF calculations are intended for integers.
Stopping fraction reduction too early
Using the full GCF removes all common factors at once.
Quick examples
| Integers | GCF |
|---|---|
| 8, 12 | 4 |
| 12, 18 | 6 |
| 18, 24 | 6 |
| 21, 28 | 7 |
| 24, 36 | 12 |
| 48, 60 | 12 |
| 72, 120 | 24 |
| 8, 15 | 1 |
The final example shows a pair of coprime numbers.
When to use another calculator
Use the LCM Calculator when you need the smallest positive multiple shared by several integers.
Use the Proportion Calculator when you need to solve a missing value in two equivalent ratios.
For everyday addition, subtraction, multiplication, division, and grouped arithmetic, use the Basic Calculator.
FAQ
What is the GCF?
The greatest common factor is the largest positive integer that divides every entered integer without a remainder.
Is GCF the same as GCD?
Yes.
Greatest common factor and greatest common divisor refer to the same value.
How do I find the GCF of 12 and 18?
Their common factors are:
1, 2, 3, and 6
The largest is:
6
So:
GCF(12, 18) = 6
What is the GCF of coprime numbers?
It is:
1
Coprime numbers share no positive factor greater than 1.
Can the GCF equal one of the numbers?
Yes.
If one input divides every other input, it can be the GCF.
For example:
GCF(12, 36) = 12
Can the GCF be negative?
The standard GCF is reported as a positive integer.
Negative inputs are handled using their absolute values.
What is the GCF of a number and zero?
For nonzero:
a
the standard relationship is:
GCF(a, 0) = |a|
What is GCF(0,0)?
It is generally treated as undefined in elementary mathematics because every positive integer divides zero and there is no greatest one.
Some software systems may use another convention.
Can I find the GCF of more than two numbers?
Yes.
Find the GCF of the first two values, then combine that result with the next value until every input has been processed.
Can decimals have a GCF?
The ordinary GCF calculation is defined for integers.
Do not silently round decimal inputs.
How does GCF simplify a fraction?
Find the GCF of the numerator and denominator and divide both by it.
For example:
84/126
has:
GCF = 42
so:
84/126 = 2/3
What is the difference between GCF and LCM?
The GCF is the greatest positive number that divides all inputs.
The LCM is the smallest positive number that is divisible by all inputs.
Why does the Euclidean algorithm work?
It repeatedly replaces a pair of numbers with the smaller number and the remainder without changing their greatest common divisor.
When the remainder reaches zero, the last nonzero remainder is the GCF.
Mathematics reference
For additional explanations and worked examples involving factors, prime factorization, fractions, GCF, and related arithmetic, see:
Find the factor shared by every number
A GCF Calculator answers one specific divisibility question:
What is the largest positive integer that divides every entered integer exactly?
For small numbers, factor lists make the relationship easy to see.
Prime factorization reveals the shared primes.
Euclid’s algorithm provides an efficient method for much larger values.
Whichever method is used, verify the result by dividing every original number by the proposed GCF.
If every quotient is a whole number and no larger common divisor exists, the result is correct.
