Math
GCF and LCM calculator
Both come from the same prime factorisations — the GCF takes the lowest power of each shared prime, the LCM the highest.
Both from the same factorisation
Take 48 = 24 × 3 and 180 = 22 × 32 × 5. To find the greatest common factor, take each prime that appears in both and use the lower exponent: 22 × 3 = 12. For the lowest common multiple, take every prime that appears in either at the higher exponent: 24 × 32 × 5 = 720.
That symmetry explains the identity GCF × LCM = a × b for any pair. Every prime power in the product is counted once in each, just distributed differently. The identity does not extend to three or more numbers.
Euclid's algorithm
Factorising large numbers is slow. Euclid's method, from around 300 BCE, finds the GCF without factorising anything: repeatedly replace the larger number with the remainder of dividing it by the smaller, until the remainder is zero. The last non-zero value is the GCF.
For 210 and 48: 210 = 4×48 + 18, then 48 = 2×18 + 12, then 18 = 1×12 + 6, then 12 = 2×6 + 0. The GCF is 6, reached in four steps. The method is remarkably fast — the number of steps grows only logarithmically with the size of the inputs — and it remains the standard approach in computing today.
Where each one is used
GCF simplifies fractions: dividing 48/180 by their GCF of 12 gives 4/15 in one step. It also answers division problems — the largest identical groups you can make from several quantities, or the largest square tile that fits a rectangular room exactly.
LCM finds common denominators for adding fractions, and answers synchronisation questions: two buses leaving every 12 and 18 minutes coincide every 36 minutes. Gear ratios, repeating schedules and cycle alignment problems all reduce to an LCM.
Coprime numbers
Two numbers with a GCF of 1 are coprime — they share no prime factor. They need not be prime themselves: 8 and 15 are coprime despite both being composite.
The property matters in cryptography, where RSA depends on choosing an exponent coprime to a particular value, and in engineering, where coprime gear tooth counts spread wear evenly because the same pair of teeth meets only once per full cycle.
Common questions
What is the difference between GCF, GCD and HCF?
Nothing — greatest common factor, greatest common divisor and highest common factor are three names for the same quantity. GCD is more common in computing and number theory, HCF in British schools, GCF in American ones.
What is the GCF if one number is zero?
By convention, the GCD of 0 and n is n, since every integer divides zero. The calculator excludes zero to avoid the ambiguity, since the LCM involving zero is not well defined.
How do I find the LCM of three or more numbers?
Apply it in pairs: LCM(a, b, c) = LCM(LCM(a, b), c). The same works for the GCF. The calculator does this automatically for any number of inputs.
Why does GCF × LCM = a × b only work for two numbers?
Because with three or more, a prime can appear at an intermediate exponent in one number that is counted in neither the minimum nor the maximum. The identity depends on every exponent being either the smallest or the largest, which is only guaranteed when there are two.