GCF & LCM Calculator
Find the greatest common factor and least common multiple of two or more numbers. Shows prime factorization and all common factors.
What Are GCF and LCM?
The Greatest Common Factor (GCF), also called GCD (Greatest Common Divisor) or HCF (Highest Common Factor), is the largest number that divides evenly into all the given numbers. The Least Common Multiple (LCM) is the smallest number that all the given numbers divide into evenly.
For two numbers a and b:
GCF x LCM = a x b
LCM(a,b) = (a x b) / GCF(a,b)
Finding GCF by Prime Factorization
Write each number as a product of primes. The GCF is the product of all prime factors that appear in every number, using the lowest power of each. For example, 24 = 2³ x 3 and 36 = 2² x 3². The shared primes are 2 (lowest power 2²) and 3 (lowest power 3¹). So GCF = 4 x 3 = 12.
Finding LCM by Prime Factorization
The LCM is the product of all prime factors that appear in any number, using the highest power of each. For 24 = 2³ x 3 and 36 = 2² x 3²: take 2³ (highest power of 2) and 3² (highest power of 3). LCM = 8 x 9 = 72. You can verify: 72/24 = 3 and 72/36 = 2, both whole numbers.
When do you use GCF in real life?
The GCF is used to simplify fractions (divide numerator and denominator by their GCF), split things into equal groups (like dividing 24 apples and 36 oranges into identical baskets), and tile rectangular areas with square tiles.
When do you use LCM in real life?
The LCM helps find common denominators when adding fractions, schedule events that repeat at different intervals (like two buses that run every 12 and 15 minutes), and solve problems involving synchronization.
What if the GCF is 1?
If the GCF of two numbers is 1, they are called "coprime" or "relatively prime." They share no common factors other than 1. Examples include 8 and 15, or 7 and 20. Their LCM equals their product.
Can you find GCF and LCM of more than two numbers?
Yes. This calculator supports any number of inputs. For GCF, find the GCF of the first two numbers, then find the GCF of that result with the third number, and so on. The same chaining approach works for LCM.