LCM & GCF Calculator
Calculate the Least Common Multiple (LCM) and Greatest Common Factor (GCF/GCD) of two or more numbers with step-by-step solutions.
Tip: Enter positive whole numbers like 12, 18, 24 to find their GCF and LCM. Press Enter to calculate.
Find GCF & LCM
Enter two or more numbers to find their Greatest Common Factor (GCF) and Least Common Multiple (LCM).
About This Calculator
Finding the Least Common Multiple (LCM) and Greatest Common Factor (GCF) is one of the most fundamental skills in mathematics, yet it's also one that trips up students and adults alike. Whether you're adding fractions with different denominators, scheduling events that repeat at different intervals, or solving complex number theory problems, understanding LCM and GCF is essential.
The Greatest Common Factor (GCF), also known as the Greatest Common Divisor (GCD) or Highest Common Factor (HCF), is the largest positive integer that divides two or more numbers without leaving a remainder. For example, the GCF of 12 and 18 is 6, because 6 is the largest number that divides both 12 and 18 evenly. The GCF is crucial for simplifying fractions to their lowest terms and solving problems involving divisibility.
The Least Common Multiple (LCM), sometimes called the Lowest Common Multiple, is the smallest positive integer that is divisible by two or more numbers. For example, the LCM of 4 and 6 is 12, because 12 is the smallest number that both 4 and 6 divide into evenly. When you add or subtract fractions with different denominators, you need to find the LCD (Lowest Common Denominator), which is simply the LCM of the denominators.
Our LCM and GCF Calculator goes far beyond simple computation. Enter two or more numbers, and instantly see both results along with detailed step-by-step solutions using two powerful methods: prime factorization and the Euclidean algorithm. The visual Venn diagram shows how factors relate to each other, making abstract concepts concrete. Whether you're a student learning these concepts for the first time, a teacher preparing examples, or an engineer solving practical problems, this calculator provides the clarity and depth you need.
Trusted Sources
How to Use the LCM & GCF Calculator
- 1**Enter your numbers**: Type two or more positive integers into the input field, separated by commas or spaces. For example: 12, 18, 24 or 24 36 48.
- 2**Click Calculate**: Press the 'Calculate GCF & LCM' button or simply hit Enter. The calculator will process your numbers instantly.
- 3**View main results**: The results section displays the GCF, LCM, and LCD clearly at the top. These are your primary answers.
- 4**Explore prime factorization**: See each number broken down into its prime factors, showing exactly how the GCF and LCM are derived from minimum and maximum exponents.
- 5**Examine the Venn diagram**: For two numbers, the visual diagram shows common factors in the overlap and unique factors on each side, making the concept of GCF intuitive.
- 6**Review all factors**: See complete factor lists for each number, with common factors highlighted in amber for easy identification.
- 7**Study the Euclidean algorithm**: Toggle the step-by-step breakdown to see how this efficient algorithm finds the GCF through repeated division.
- 8**Apply to fractions**: The LCD section demonstrates how to convert fractions to equivalent fractions with a common denominator.
Formula
GCF: Take minimum exponents of common primes
LCM: Take maximum exponents of all primes
Relationship: GCF(a,b) x LCM(a,b) = a x bFor prime factorization method: express each number as a product of prime powers. The GCF uses the smallest exponent for each prime that appears in ALL numbers. The LCM uses the largest exponent for each prime that appears in ANY number. The Euclidean algorithm finds GCF by repeatedly dividing: GCF(a,b) = GCF(b, a mod b) until the remainder is 0.
Understanding GCF: Greatest Common Factor
The Greatest Common Factor (GCF) is the largest positive integer that divides two or more numbers without a remainder. It's also called:
- GCD (Greatest Common Divisor) - common in mathematics
- HCF (Highest Common Factor) - used in British English
- HCD (Highest Common Divisor) - less common variant
Why GCF Matters:
- Simplifying Fractions: To reduce 18/24 to lowest terms, divide both by GCF(18,24) = 6, giving 3/4
- Factoring Expressions: In algebra, GCF helps factor expressions like 12x + 18y = 6(2x + 3y)
- Distributing Items: If you have 24 red balls and 36 blue balls to distribute equally among groups, the maximum group size is GCF(24,36) = 12
Properties of GCF:
- GCF(a,a) = a (any number's GCF with itself is the number)
- GCF(a,1) = 1 (any number's GCF with 1 is 1)
- GCF(a,0) = a (any number's GCF with 0 is the number)
- If GCF(a,b) = 1, then a and b are called 'coprime' or 'relatively prime'
Understanding LCM: Least Common Multiple
The Least Common Multiple (LCM) is the smallest positive integer that is divisible by all the given numbers. It's also called the Lowest Common Multiple.
Why LCM Matters:
- Adding Fractions: To add 1/4 + 1/6, find LCM(4,6) = 12, then convert: 3/12 + 2/12 = 5/12
- Scheduling Problems: If Event A happens every 4 days and Event B every 6 days, they coincide every LCM(4,6) = 12 days
- Gear Ratios: In mechanics, LCM determines when gear teeth realign
Properties of LCM:
- LCM(a,a) = a
- LCM(a,1) = a
- LCM(a,b) is always >= max(a,b)
- The product relationship: GCF(a,b) x LCM(a,b) = a x b
LCD (Lowest Common Denominator): The LCD is simply the LCM of the denominators when working with fractions. For fractions with denominators 4, 6, and 8:
- LCD = LCM(4, 6, 8) = 24
- 1/4 = 6/24, 1/6 = 4/24, 1/8 = 3/24
Method 1: Prime Factorization
Prime factorization breaks each number into a product of prime numbers. This method clearly shows the relationship between GCF and LCM.
Step-by-Step Process:
- Find the prime factorization of each number
- For GCF: Take each prime that appears in ALL numbers with the MINIMUM exponent
- For LCM: Take each prime that appears in ANY number with the MAXIMUM exponent
Example: Find GCF and LCM of 12, 18, and 30
Prime factorizations:
- 12 = 2^2 x 3^1
- 18 = 2^1 x 3^2
- 30 = 2^1 x 3^1 x 5^1
For GCF (minimum exponents of common primes):
- Prime 2: min(2,1,1) = 1
- Prime 3: min(1,2,1) = 1
- Prime 5: not in all numbers, skip
- GCF = 2^1 x 3^1 = 6
For LCM (maximum exponents of all primes):
- Prime 2: max(2,1,1) = 2
- Prime 3: max(1,2,1) = 2
- Prime 5: max(0,0,1) = 1
- LCM = 2^2 x 3^2 x 5^1 = 4 x 9 x 5 = 180
Method 2: Euclidean Algorithm
The Euclidean algorithm is an efficient method for finding the GCF of two numbers. It's based on the principle that GCF(a,b) = GCF(b, a mod b).
The Algorithm:
- Divide the larger number by the smaller
- Replace the larger number with the remainder
- Repeat until the remainder is 0
- The last non-zero remainder is the GCF
Example: Find GCF(48, 18)
48 = 18 x 2 + 12 (48 divided by 18 = 2 remainder 12)
18 = 12 x 1 + 6 (18 divided by 12 = 1 remainder 6)
12 = 6 x 2 + 0 (12 divided by 6 = 2 remainder 0)
The last non-zero remainder is 6, so GCF(48, 18) = 6.
Why It Works: If d divides both a and b, then d also divides (a - qb) for any integer q. The algorithm exploits this property to reduce the problem to smaller numbers.
Finding LCM from GCF: Once you have the GCF, find LCM using: LCM(a,b) = (a x b) / GCF(a,b)
For 48 and 18: LCM = (48 x 18) / 6 = 864 / 6 = 144
Applications: Fractions and LCD
One of the most common uses of LCM is finding the Lowest Common Denominator (LCD) for fraction operations.
Adding and Subtracting Fractions:
To add 2/15 + 3/20:
-
Find LCD = LCM(15, 20)
- 15 = 3 x 5
- 20 = 2^2 x 5
- LCM = 2^2 x 3 x 5 = 60
-
Convert fractions:
- 2/15 = (2 x 4)/(15 x 4) = 8/60
- 3/20 = (3 x 3)/(20 x 3) = 9/60
-
Add: 8/60 + 9/60 = 17/60
Simplifying Fractions with GCF:
To simplify 84/126:
- Find GCF(84, 126) = 42
- Divide: 84/126 = (84/42)/(126/42) = 2/3
Comparing Fractions:
Which is larger: 5/12 or 7/18?
- Find LCD = LCM(12, 18) = 36
- Convert: 5/12 = 15/36, 7/18 = 14/36
- Compare: 15/36 > 14/36, so 5/12 > 7/18
Applications: Scheduling and Real-World Problems
LCM and GCF solve many practical problems involving cycles and distribution.
Scheduling Problems (LCM):
Problem: Three buses arrive at a station. Bus A comes every 15 minutes, Bus B every 20 minutes, and Bus C every 25 minutes. If all three arrive together at 8:00 AM, when will they next arrive together?
Solution: Find LCM(15, 20, 25)
- 15 = 3 x 5
- 20 = 2^2 x 5
- 25 = 5^2
- LCM = 2^2 x 3 x 5^2 = 300 minutes = 5 hours
They'll next arrive together at 1:00 PM.
Distribution Problems (GCF):
Problem: You have 48 red flowers and 60 yellow flowers. You want to make identical bouquets using all flowers with no flowers left over. What's the maximum number of bouquets?
Solution: Find GCF(48, 60)
- 48 = 2^4 x 3
- 60 = 2^2 x 3 x 5
- GCF = 2^2 x 3 = 12
You can make 12 bouquets, each with 4 red and 5 yellow flowers.
Tiling Problems (GCF):
Problem: What is the largest square tile that can exactly cover a 48cm x 60cm floor?
Solution: The tile side must divide both dimensions evenly. GCF(48, 60) = 12cm tiles
Pro Tips
- 💡Remember the key relationship: GCF(a,b) x LCM(a,b) = a x b. This is useful for checking your work or finding one value from the other.
- 💡For quick mental math, if one number divides the other evenly (like 4 and 12), then GCF = smaller number and LCM = larger number.
- 💡When adding fractions, always find the LCD (which is the LCM of denominators) to avoid unnecessarily large numbers in your calculations.
- 💡If two consecutive integers share a GCF, it's always 1. Consecutive integers are always coprime (relatively prime).
- 💡For large numbers, the Euclidean algorithm is much faster than listing all factors. It works efficiently even for numbers in the millions.
- 💡To simplify a fraction, divide both numerator and denominator by their GCF. If GCF = 1, the fraction is already in lowest terms.
- 💡When numbers share many common factors, their GCF will be large relative to the numbers. When they share few factors, GCF approaches 1.
- 💡The LCM is always at least as large as the largest number in your set. If the numbers are coprime, LCM = their product.
- 💡Prime numbers greater than the smallest number in your set cannot be part of the GCF. Use this to quickly eliminate candidates.
- 💡For scheduling problems, identify the cycle lengths first, then find their LCM. The answer is when all cycles align.
- 💡When working with three or more numbers, calculate GCF or LCM progressively: first find it for two numbers, then combine with the third, and so on.
- 💡In word problems, GCF usually involves dividing or distributing evenly, while LCM involves when events align or repeat together.
Frequently Asked Questions
GCF (Greatest Common Factor) is the largest number that divides evenly into all given numbers, while LCM (Least Common Multiple) is the smallest number that all given numbers divide into evenly. For example, for 12 and 18: GCF = 6 (the largest divisor of both) and LCM = 36 (the smallest multiple of both). They're related by the formula: GCF x LCM = product of the two numbers.
