LCM & GCF Calculator
Find the Least Common Multiple and Greatest Common Factor of any numbers.
Enter two or more whole numbers separated by commas, spaces, or new lines.
LCM
72
Smallest shared positive multiple.
GCF / GCD
6
Largest shared divisor.
Numbers used
12, 18, 24
Number count
3
Common factors
1, 2, 3, 6
Shown when practical.
Method
GCF + LCM pairwise
Uses Euclidean algorithm and LCM relation.
Prime factorization
Formula and Rules
Greatest Common Factor
GCF = largest positive integer that divides all inputs
Least Common Multiple
LCM = smallest positive integer divisible by all inputs
Two-number relationship
LCM(a, b) × GCF(a, b) = a × b
LCM from GCF
LCM(a, b) = |a × b| ÷ GCF(a, b)
Prime factor GCF
GCF uses lowest powers of common prime factors
Prime factor LCM
LCM uses highest powers of all prime factors
Euclidean algorithm
GCF(a, b) = GCF(b, a mod b)
Variable Explanations
a and b
Input numbers.
Factor
A number that divides another number evenly.
Multiple
The result of multiplying a number by an integer.
Common factor
A factor shared by all inputs.
Common multiple
A multiple shared by all inputs.
GCF / GCD
Greatest common factor or divisor.
LCM
Least common multiple.
Prime factor
A factor that is also a prime number.
LCM vs GCF Explained
GCF looks downward
GCF finds shared factors. For 12 and 18, the common factors are 1, 2, 3, and 6, so the GCF is 6.
LCM looks upward
LCM finds shared multiples. For 12 and 18, common multiples include 36, 72, and 108, so the LCM is 36.
Worked Examples
Find GCF and LCM of 12 and 18
Method: Prime factors: 12 = 2² × 3, 18 = 2 × 3²
Steps: GCF = 2 × 3 = 6, LCM = 2² × 3² = 36
Answer: GCF = 6, LCM = 36
Find GCF and LCM of 8 and 20
Method: 8 = 2³, 20 = 2² × 5
Steps: GCF uses 2², LCM uses 2³ × 5
Answer: GCF = 4, LCM = 40
Find GCF and LCM of 6, 9, and 15
Method: 6 = 2 × 3, 9 = 3², 15 = 3 × 5
Steps: Shared factor is 3; highest powers are 2 × 3² × 5
Answer: GCF = 3, LCM = 90
Use prime factorization for GCF
Method: Compare only shared prime factors
Steps: Use the lowest powers shared by every number
Answer: This gives the GCF
Use prime factorization for LCM
Method: Collect every prime factor needed
Steps: Use the highest power of each prime factor
Answer: This gives the LCM
Euclidean algorithm for 48 and 18
Method: 48 mod 18 = 12, 18 mod 12 = 6, 12 mod 6 = 0
Steps: Last non-zero remainder is 6
Answer: GCF = 6
LCM for a common denominator
Method: To add 1/6 + 1/8, find LCM(6, 8)
Steps: LCM = 24
Answer: Use 24 as the common denominator
GCF to simplify a fraction
Method: Simplify 18/24
Steps: GCF(18, 24) = 6
Answer: 18/24 = 3/4
Prime Factorization and Euclidean Method
Prime factorization method
Break numbers into prime factors. GCF uses shared factors with the lowest powers. LCM uses all factors with the highest powers.
Euclidean algorithm
Repeatedly divide and use remainders. Stop when the remainder is zero. The last non-zero remainder is the GCF.
Common Use Cases
Common LCM and GCF Mistakes
Frequently Asked Questions
Related tools