GCF and LCM Calculator - Find Both Values
Calculate both the Greatest Common Factor and Least Common Multiple at once. Enter two or more numbers to find GCF and LCM with step-by-step solutions.
Formula
LCM(a,b) = |a×b| / GCF(a,b)
The LCM is the product of the numbers divided by their GCF. The GCF is the largest shared divisor.
Worked Examples
Example 1: GCF and LCM of 12 and 18
Problem:Find the greatest common factor and least common multiple of 12 and 18.
Solution:Listing method: Factors of 12: 1, 2, 3, 4, 6, 12 Factors of 18: 1, 2, 3, 6, 9, 18 Common factors: 1, 2, 3, 6 - the greatest is 6, so GCF = 6 Multiples of 12: 12, 24, 36, 48... Multiples of 18: 18, 36, 54... First shared multiple is 36, so LCM = 36 Prime method: 12 = 2² × 3 and 18 = 2 × 3². GCF takes the lowest power of each shared prime (2 × 3 = 6); LCM takes the highest power of every prime (2² × 3² = 36). Identity check: GCF × LCM = 6 × 36 = 216 = 12 × 18.
Result:GCF = 6 | LCM = 36 | 6 × 36 = 12 × 18
Example 2: Coprime Numbers
Problem:Find the GCF and LCM of 8 and 9.
Solution:8 = 2³ and 9 = 3², so they share no prime factor at all. GCF = 1, which is the definition of coprime (also called relatively prime). When the GCF is 1 the LCM is simply the product: LCM = 8 × 9 = 72. Note that neither number is prime on its own - coprimality is about the pair, not about either number being prime.
Result:GCF = 1 (coprime) | LCM = 72
Example 3: Larger Numbers via the Euclidean Algorithm
Problem:Find the GCF and LCM of 48 and 180.
Solution:Euclidean algorithm (repeated remainders) is faster than listing factors: 180 = 3 × 48 + 36 48 = 1 × 36 + 12 36 = 3 × 12 + 0 The last nonzero remainder is 12, so GCF = 12. LCM = |a × b| / GCF = 48 × 180 / 12 = 8640 / 12 = 720 Prime check: 48 = 2⁴ × 3 and 180 = 2² × 3² × 5, so GCF = 2² × 3 = 12 and LCM = 2⁴ × 3² × 5 = 720. Both agree.
Result:GCF = 12 | LCM = 720
Frequently Asked Questions
What is the difference between GCF and GCD?
They are the same thing. GCF stands for Greatest Common Factor, and GCD stands for Greatest Common Divisor.
Can GCF be 1?
Yes. If the numbers share no common factors other than 1, they are called "relatively prime" or "coprime" (e.g., 8 and 15).
How do I find the LCM of more than two numbers?
Find the LCM of the first two numbers, then find the LCM of that result and the third number, and so on.
Can GCF be larger than LCM?
No. GCF is a factor (smaller or equal), and LCM is a multiple (larger or equal). Thus, GCF ≤ LCM.
What is the LCM of prime numbers?
The LCM of distinct prime numbers is their product. For example, LCM(3, 5) = 15.
Does GCF work for negative numbers?
In standard arithmetic, we typically use positive integers. If inputs are negative, use their absolute values.
What is the relationship between GCF and LCM?
For two numbers a and b: a × b = GCF(a, b) × LCM(a, b).
Real-world example of GCF?
Splitting different quantities of items into equal-sized groups (e.g., making identical goody bags from 12 candies and 18 toys).
Background & Theory
Greatest Common Factor (GCF):
Also known as the Greatest Common Divisor (GCD). It is the largest positive integer that divides each of the integers without a remainder.
- Useful for simplifying fractions.
- Found by listing factors or using prime factorization.
Least Common Multiple (LCM):
The smallest positive integer that is divisible by each of the integers.
- Useful for finding common denominators for fractions.
- Relationship: LCM(a, b) = |a × b| / GCF(a, b)
Methods:
- Listing Method: List multiples/factors and find the match.
- Prime Factorization: Break numbers down to primes.
- GCF: Product of lowest powers of common primes.
- LCM: Product of highest powers of all primes.
- Euclidean Algorithm: Efficient for finding GCF of large numbers.