GCF and LCM Calculator
Find the Greatest Common Factor (GCF) and Least Common Multiple (LCM) of two or more numbers instantly, with step-by-step prime factorization shown.
How to Use This Calculator
- Enter two or more whole numbers separated by commas (e.g.
12, 18, 24) - Click Calculate to see the GCF and LCM
- Review the prime factorization and step-by-step work for each number
📐 GCF vs. LCM — Quick Reference
- GCF (Greatest Common Factor): The largest number that divides evenly into every number in the set. Used to simplify fractions to lowest terms.
- LCM (Least Common Multiple): The smallest number that every number in the set divides into evenly. Used to find a common denominator when adding or subtracting fractions.
- Prime factorization method: Break each number into its prime factors. The GCF is the product of the shared primes at their lowest shared power; the LCM is the product of every prime involved at its highest power.
- Shortcut: For two numbers, LCM(a, b) = (a × b) ÷ GCF(a, b).
🔢 Worked Example: 12 and 18
- 12 = 2 × 2 × 3
- 18 = 2 × 3 × 3
- Shared primes at lowest power: 2 × 3 = GCF = 6
- All primes at highest power: 2 × 2 × 3 × 3 = LCM = 36
Frequently Asked Questions
What is the difference between GCF and LCM?
The GCF (Greatest Common Factor) is the largest number that divides evenly into two or more numbers, while the LCM (Least Common Multiple) is the smallest number that both numbers divide into evenly. For example, for 12 and 18: the GCF is 6 (the largest shared factor) and the LCM is 36 (the smallest shared multiple).
How do you find the GCF of two numbers?
List the prime factors of each number, then multiply together the factors they have in common (using the lowest power of each shared prime). For 24 (2×2×2×3) and 36 (2×2×3×3), the shared factors are 2×2×3 = 12, so the GCF is 12. You can also use the Euclidean algorithm: repeatedly divide the larger number by the smaller and replace it with the remainder until the remainder is 0.
How do you find the LCM of two numbers?
One fast method uses the GCF: LCM(a, b) = (a × b) ÷ GCF(a, b). For 8 and 12, the GCF is 4, so the LCM is (8 × 12) ÷ 4 = 24. You can also list multiples of each number until you find the smallest one they share.
Can this calculator find the GCF and LCM of more than two numbers?
Yes. Enter as many numbers as you need (separated by commas) and the calculator finds the GCF and LCM across the whole set by combining the prime factorizations of every number you enter.
What is the GCF or LCM of a number and 0?
The GCF of any number and 0 is the number itself, since every number divides 0 evenly. The LCM involving 0 is defined as 0, since 0 is the only common multiple.
Why do students need to know GCF and LCM?
GCF is used to simplify fractions to lowest terms (divide numerator and denominator by their GCF), and LCM is used to find a common denominator when adding or subtracting fractions with different denominators. Both also show up in scheduling problems, ratio simplification, and factoring in algebra.