GCF Calculator (Greatest Common Factor)
The greatest common factor of two or more whole numbers — the largest number that divides them all exactly.
The greatest common factor, also called the highest common factor or greatest common divisor, is the biggest number that goes into every value you enter without a remainder.
How the gcf calculator (greatest common factor) works
The greatest common factor, also called the highest common factor or greatest common divisor, is the biggest number that goes into every value you enter without a remainder. Euclid's algorithm finds it far faster than listing factors: repeatedly replace the larger number with the remainder of dividing it by the smaller, and the last non-zero value is the answer. It is what reduces a fraction to lowest terms.
Formula: gcd(a, b) = gcd(b, a mod b); lcm(a, b) = |a × b| / gcd(a, b)
Worked examples
| Inputs | Greatest common divisor | Note |
|---|---|---|
| GCF of 12, 18 and 30 | 6 | 6 |
| GCF of 48 and 60 | 12 | 12 |
| GCF of 17 and 25 | 1 | 1 — they are coprime |
FAQFrequently asked questions
What is the greatest common factor?
The largest whole number that divides all your numbers exactly. For 12 and 18 it is 6.
Is GCF the same as HCF and GCD?
Yes — greatest common factor, highest common factor and greatest common divisor are three names for one thing.
How do I use it to simplify a fraction?
Divide top and bottom by it: 18/24 has GCF 6, giving 3/4.
What if the numbers share nothing?
The GCF is 1 and they are called coprime — like 8 and 15.
What is Euclid's algorithm?
Replace the larger number with its remainder when divided by the smaller, and repeat. The last non-zero value is the GCF, and it is thousands of times faster than listing factors.
Where these figures come from
- NIST Digital Library of Mathematical Functions — reference definitions for elementary and special functions
- Wolfram MathWorld — definitions and formulas for every topic on this page
- NIST/SEMATECH e-Handbook of Statistical Methods — the statistical formulas (mean, variance, z, confidence intervals, sample size)
- National curriculum in England — Mathematics — the terms and methods taught in UK schools
Last checked: September 2026. Formulas are fixed by mathematics and do not change with tax years or regulations.