This GCF calculator finds the greatest common factor (also called GCD) of two or three positive integers. Enter the values in the form above. The tool returns a single GCF you can use to simplify fractions, compare shared divisors, or check homework work.
Table of Contents
How to use the GCF calculator
- Enter the first positive integer in field A.
- Enter the second positive integer in field B.
- Optionally enter a third positive integer in field C when you need the GCF of three numbers.
- Read the GCF result. Leave C empty or at zero when you only need two inputs.
How the GCF is calculated
The calculator uses the Euclidean algorithm. For two integers a and b it repeatedly replaces the larger value with the remainder of division until the remainder is zero. The last non-zero remainder is the GCF. If you also enter C, it computes GCF(GCF(a, b), c).
Example path for 48 and 18: 48 = 2 × 18 + 12, then 18 = 1 × 12 + 6, then 12 = 2 × 6 + 0. The GCF is 6.
Worked example
Simplify the fraction 48/18. The GCF of 48 and 18 is 6. Divide numerator and denominator by 6 to get 8/3. That is the reduced form of the fraction.
Three-number check: GCF(24, 36, 60). First GCF(24, 36) = 12. Then GCF(12, 60) = 12. So the shared greatest factor is 12.
GCF vs common factors vs LCM
GCF returns one number: the largest positive integer that divides every input. The common factors of your numbers are the positive divisors of their GCF. For example, if the GCF is 6, the common factors are 1, 2, 3 and 6. Use the common factor calculator to find the full list., use the common factor calculator. For the smallest shared multiple, use the LCM calculator. To list every divisor of one number, open the factor calculator. For a prime factor tree, use the prime factorization calculator.
When a GCF calculator helps
- Reducing fractions before adding or comparing them.
- Finding a common tile size or packaging unit that divides two lengths or counts.
- Checking algebra steps where you factor out a shared coefficient.
- Quick verification when prime factorization feels slow for large pairs.
What Is the Greatest Common Factor?
The greatest common factor, or GCF, is the largest positive whole number that divides every number in a group without leaving a remainder.
For example, 12 and 18 share the factors 1, 2, 3 and 6. The largest is 6, so their GCF is 6.
You may also see it called the greatest common divisor (GCD) or highest common factor (HCF). These names mean the same thing for positive whole numbers.
How to Find GCF With Steps
Your calculator result gives you the answer. If you need to show your work, factor listing and prime factorization are two useful methods.
Find GCF by Listing Factors
To find the GCF of 30 and 54:
- List the factors of 30: 1, 2, 3, 5, 6, 10, 15, 30.
- List the factors of 54: 1, 2, 3, 6, 9, 18, 27, 54.
- Find the factors appearing in both lists: 1, 2, 3, 6.
- Choose the largest: 6.
The GCF of 30 and 54 is 6.
You can check the answer by dividing both numbers by 6:
30 ÷ 6 = 5
54 ÷ 6 = 9
Both divisions leave no remainder.
Find GCF Using Prime Factorization
Prime factorization breaks each number into a product of prime numbers.
For example, find the GCF of 48 and 60:
48 = 2 × 2 × 2 × 2 × 3
60 = 2 × 2 × 3 × 5
Both numbers contain two factors of 2 and one factor of 3. Multiply those shared factors:
2 × 2 × 3 = 12
The GCF of 48 and 60 is 12.
Use only the factors shared by every number. Extra factors appearing in just one number do not belong in the GCF.
GCF With Variables
The calculator above accepts whole numbers, not expressions containing variables. However, you can use it to find the GCF of numerical coefficients, then work out the shared variable factors yourself.
To find the GCF of algebraic terms:
- Find the GCF of their numerical coefficients.
- Identify the variables present in every term.
- Use the smallest exponent of each shared variable.
- Multiply the coefficient GCF by those variable factors.
Example: GCF of 12x² and 18x³
The GCF of 12 and 18 is 6.
Both terms contain x. The smallest exponent is 2, so the shared variable factor is x².
GCF of 12x² and 18x³ = 6x²
Example: GCF of 8x²y and 12xy²
The GCF of 8 and 12 is 4.
Both terms contain x and y. The smallest exponent of each variable is 1.
GCF of 8x²y and 12xy² = 4xy
If a variable does not appear in every term, leave it out. For example, the GCF of 10x and 15y is 5, because the terms have no shared variable.
Using GCF to Factor Polynomials
Finding the GCF of a polynomial’s terms helps you factor out their shared numerical and variable parts.
For example:
12x³ + 18x²
The coefficients have a GCF of 6, and both terms contain x². Their greatest common factor is 6x².
Divide each term by 6x² to find what remains inside the brackets:
12x³ + 18x² = 6x²(2x + 3)
Check the result by multiplying 6x² by each term inside the brackets.
Example With Three Terms
Factor:
15x³ + 25x² + 10x
The coefficients 15, 25 and 10 have a GCF of 5. Every term also contains x.
Therefore:
15x³ + 25x² + 10x = 5x(3x² + 5x + 2)
These examples explain how to find the GCF of individual terms. Finding a common factor between two complete polynomials may require additional factoring or polynomial division. This calculator does not process polynomial expressions.
How to Find GCF Easily
Listing factors works well for small numbers. For larger numbers, use the calculator or follow the Euclidean algorithm explained above.
These quick checks can help you spot mistakes:
- If the smaller number divides the larger exactly, the smaller number is their GCF. For example, the GCF of 8 and 40 is 8.
- Consecutive positive whole numbers have a GCF of 1. For example, the GCF of 14 and 15 is 1.
- If all your numbers are even, their GCF is at least 2.
- The GCF cannot be larger than the smallest positive input.
- Your answer must divide every input without leaving a remainder.
Limitations
A and B must be positive whole numbers. Leave the optional C field blank or set it to zero when comparing only two numbers. To compare three numbers, enter a positive whole number in C. The calculator does not accept decimals, fractions, negative numbers, variables or polynomial expressions. Very large inputs may exceed the browser’s safe integer range and produce unreliable results.