How to use the GCF Calculator
- Type your numbers separated by commas or spaces.
- Read the greatest common factor.
- Check the LCM row when you need a common denominator instead.
- Add more numbers freely — the method extends to any list length.
How the calculation works
The Euclidean algorithm finds the GCF without factorising anything. Repeatedly replace the larger number with the remainder of dividing it by the smaller; when the remainder hits zero, the last non-zero value is the GCF. It is over two thousand years old and still the fastest general method, running in time proportional to the number of digits rather than the size of the numbers.
For a list, the GCF is computed pairwise: gcd(a, b, c) equals gcd(gcd(a, b), c). The same associativity applies to the LCM, which is derived from the GCF by the identity lcm(a, b) = |a·b| ÷ gcd(a, b) — computing it this way avoids the overflow you get from multiplying a long list together first.
In practice the GCF is what reduces a fraction to lowest terms, and the LCM is what finds a common denominator or the interval at which two repeating schedules coincide.
gcd(a, b) = gcd(b, a mod b) until b = 0 ; lcm(a, b) = |a × b| / gcd(a, b)Source: Euclidean algorithm, Euclid's Elements Book VII; standard gcd–lcm identity.
Worked example
Cutting 48 cm, 180 cm and 84 cm of ribbon into equal pieces with none wasted.
- gcd(48, 180): 180 mod 48 = 36; 48 mod 36 = 12; 36 mod 12 = 0 → 12.
- gcd(12, 84) = 12.
- Pieces: 48/12 + 180/12 + 84/12 = 4 + 15 + 7.
12 cm pieces — 26 of them, with nothing left over.
Frequently asked questions
Is GCF the same as HCF?+
Yes. Greatest common factor, highest common factor and greatest common divisor all mean the same thing.
What is the GCF of two coprime numbers?+
1. Numbers sharing no factor other than one are called coprime or relatively prime.
Does the gcd–lcm identity work for three numbers?+
Not directly. Apply it pairwise: lcm(a, b, c) = lcm(lcm(a, b), c).
Why not just list all the factors?+
It works for small numbers but becomes impractical fast. The Euclidean algorithm handles very large values instantly.
Last reviewed September 1, 2026. We review this page whenever the underlying formula, tax year, published rate or standard changes.