Calculating...
Enter two or more positive integers and click Calculate GCF & LCM to see the results with full working.
How GCF and LCM Are Found
gcd(a, b): replace a with b, b with a mod b, until b = 0. GCF = last non-zero remainder
LCM(a, b) = (a × b) ÷ GCF(a, b) LCM(a,b,c) = LCM(LCM(a,b), c)
GCF × LCM = a × b (true for any two numbers)
GCF = 1 → coprime (relatively prime) LCM(a, b) = a × b when coprime
What Is the Greatest Common Factor (GCF)?
The GCF — also called the Greatest Common Divisor (GCD) or Highest Common Factor (HCF) in British English — is the largest positive integer that divides evenly into every number in a set. For 12 and 18, the GCF is 6 because 6 is the largest number that divides both without a remainder: 12 ÷ 6 = 2 and 18 ÷ 6 = 3.
The most practical use of GCF is simplifying fractions. To reduce 12/18 to lowest terms, divide both the numerator and the denominator by their GCF: 12 ÷ 6 = 2, 18 ÷ 6 = 3, giving the simplified fraction 2/3. Any fraction reduced this way is already in its simplest form because the GCF is the largest possible divisor.
Another real-world use: suppose you have two pieces of rope measuring 48 cm and 18 cm, and you want to cut both into the longest equal pieces with nothing left over. The answer is GCF(48, 18) = 6 cm — you get eight pieces from the 48 cm rope and three from the 18 cm rope.
What Is the Least Common Multiple (LCM)?
The LCM is the smallest positive integer that all the given numbers divide into evenly. For 12 and 18, the LCM is 36 because 36 is the smallest number that both 12 and 18 divide into: 36 ÷ 12 = 3 and 36 ÷ 18 = 2.
The main use of LCM is finding a common denominator when adding or subtracting fractions. To calculate 1/12 + 1/18, find LCM(12, 18) = 36 and rewrite both fractions with denominator 36: 3/36 + 2/36 = 5/36. Using the LCM as the common denominator gives the lowest common denominator — the simplest possible result.
LCM also answers scheduling problems. If bus route A runs every 6 minutes and bus route B runs every 8 minutes, and they depart together at noon, the next time they depart together is LCM(6, 8) = 24 minutes later. For a factory where machine A needs servicing every 12 hours and machine B every 18 hours, LCM(12, 18) = 36 hours is the interval at which both need servicing simultaneously.
How to Find the GCF Using the Euclidean Algorithm
The Euclidean algorithm, described by Euclid around 300 BCE, is the most efficient method for computing the GCF. It works by repeatedly replacing the larger number with the remainder when the larger is divided by the smaller, until the remainder reaches zero. The last non-zero remainder is the GCF.
Example: gcd(48, 18)
- 48 = 2 × 18 + 12 → now find gcd(18, 12)
- 18 = 1 × 12 + 6 → now find gcd(12, 6)
- 12 = 2 × 6 + 0 → remainder is 0, so GCF = 6
This is far faster than listing all factors of both numbers, especially for large values. The number of steps is at most proportional to the number of digits in the smaller number.
How to Find the LCM from the GCF
Once you have the GCF, finding the LCM requires just one more calculation:
LCM(a, b) = (a × b) ÷ GCF(a, b)
Example: LCM(12, 18) = (12 × 18) ÷ GCF(12, 18) = 216 ÷ 6 = 36.
This formula also reveals a key relationship: GCF(a, b) × LCM(a, b) = a × b — the product of any two numbers equals the product of their GCF and LCM. This is true for exactly two numbers but does not generalise to three or more.
For more than two numbers, apply the formula step by step: LCM(12, 18, 24) = LCM(LCM(12, 18), 24) = LCM(36, 24) = 72.
GCF and LCM in Real Life
These two operations appear throughout everyday maths and applied problems:
- Simplifying fractions: Always divide numerator and denominator by their GCF.
- Adding fractions: Use the LCM of the denominators as the common denominator.
- Tiling problems: A rectangular floor 12 m × 18 m can be tiled exactly with square tiles of side GCF(12, 18) = 6 m — that is the largest square tile that fits with no cutting required.
- Scheduling and synchronisation: Anything that repeats in cycles (buses, machine maintenance, planetary orbits) aligns again after LCM cycles.
- Sharing equally: If you have 48 apples and 18 oranges and want to arrange them into identical groups with no leftovers, the maximum group count is GCF(48, 18) = 6 groups.
GCF vs LCM — When to Use Each
A useful mental model: GCF shrinks, LCM grows. The GCF is always ≤ the smallest input; the LCM is always ≥ the largest input.
Use GCF when you need to split, simplify, or divide equally — you are looking for the largest piece that fits into everything. Use LCM when you need to align, schedule, or find a common base — you are looking for the smallest container that holds everything.
Two numbers with GCF = 1 are called coprime (or relatively prime). They share no common factors other than 1, so their LCM equals their product. For example, 7 and 13 are coprime: GCF = 1 and LCM = 91 = 7 × 13. Consecutive integers are always coprime.
GCF and LCM — Reference Table
| Property | GCF | LCM |
|---|---|---|
| Also called | GCD, HCF | LCM, lowest common multiple |
| Result size | ≤ smallest input | ≥ largest input |
| Main use | Simplify fractions, share equally | Common denominator, scheduling |
| Algorithm | Euclidean algorithm | LCM = (a × b) ÷ GCF |
| Special case | GCF = 1 → coprime numbers | LCM = a × b when coprime |
GCF and LCM Calculator FAQ
What is the difference between GCF and LCM?
What does it mean if the GCF of two numbers is 1?
Can the GCF be larger than either of the input numbers?
How do I use GCF to simplify a fraction?
Why is the LCM used when adding fractions?
What is the difference between GCF and HCF?
Related Calculators
Fraction Calculator
Add, subtract, multiply and divide fractions — uses GCF to simplify
Mean, Median, Mode & Range
All four basic statistics at once with step-by-step working
Significant Figures Calculator
Count sig figs and round to scientific precision
Standard Deviation Calculator
Sample and population std dev, variance, and mean