Free greatest common factor (GCF) calculator
Find the greatest common factor of two or more numbers using the Euclidean algorithm — enter your numbers to see the GCF instantly, updated live, as you type.
On this page10 sections
GCF/GCD via Euclidean algorithm. Extended to N numbers by reduction.
Results are estimates. Consult a professional.
How the greatest common factor calculator works
The greatest common factor (GCF) of two or more integers is the largest integer that divides all of them without a remainder. It is also called the greatest common divisor (GCD) or highest common factor (HCF). The most efficient method for large numbers is the Euclidean algorithm.
The Euclidean algorithm is fast even for very large numbers because each step reduces the problem size. It converges in at most O(log(min(a,b))) steps.
Weisstein, Eric W. — Greatest Common Divisor. MathWorld, Wolfram Research.Worked example: GCF(48, 18) via Euclidean algorithm
Find the greatest common factor of 48 and 18 step by step using the Euclidean algorithm.
GCF for common number pairs
The table below shows GCF results for frequently encountered number pairs — handy for simplifying fractions and ratios.
| a | b | GCF(a, b) | Simplifies fraction to |
|---|---|---|---|
| 12 | 8 | 4 | 3/2 |
| 18 | 12 | 6 | 3/2 |
| 24 | 36 | 12 | 2/3 |
| 48 | 18 | 6 | 8/3 |
| 100 | 75 | 25 | 4/3 |
| 56 | 42 | 14 | 4/3 |
| 90 | 60 | 30 | 3/2 |
| 144 | 96 | 48 | 3/2 |
GCF computed via Euclidean algorithm. "Simplifies fraction to" shows a/b ÷ GCF in lowest terms.
Tips for finding the greatest common factor
The GCF is most useful for simplifying fractions and factoring expressions. These tips speed up the process.
- Use the Euclidean algorithm for large numbers — listing all factors of 1,547 by hand is tedious; repeated division by the remainder is always faster.
- GCF of more than two numbers — compute pairwise: GCF(a, b, c) = GCF(GCF(a, b), c); the calculator handles this automatically.
- Simplify fractions in one step — divide both numerator and denominator by their GCF to reach the lowest-terms fraction immediately.
- GCF and LCM are linked — GCF(a, b) × LCM(a, b) = a × b; if you know one, you can find the other without extra work.
- GCF = 1 means the numbers are coprime — coprime integers share no common factors; this matters in modular arithmetic, cryptography, and fraction simplification.
Accuracy and limitations
The GCF calculator uses the Euclidean algorithm and returns exact integer results for any pair of positive integers within JavaScript's safe integer range (up to 2⁵³ − 1, or about 9 quadrillion). Input must be positive integers; the GCF is not defined for non-integers or zero (though GCF(a, 0) = a by convention, which is the algorithm's natural termination condition).
Key terms
About this calculator
Part of our math calculators suite — explore all calculators.