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.

Whole numbers · Prime factors · Euclidean steps

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

12 = 2^2 × 3
18 = 2 × 3^2
24 = 2^3 × 3
The GCF is 6 because it is the largest number that divides all inputs.
The LCM is 72 because it is the smallest positive multiple shared by all inputs.
Prime factorization shows why the GCF uses shared factors and the LCM uses all required factors.
LCM is useful when finding common denominators for fractions.
GCF is useful when simplifying fractions or factoring expressions.
For positive inputs, GCF is usually no larger than the smallest input and LCM is usually at least the largest input.

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.

12 = 18 × 0 + 12
18 = 12 × 1 + 6
12 = 6 × 2 + 0

Common Use Cases

Simplifying fractions
Finding common denominators
Scheduling repeated events
Grouping items evenly
Dividing resources into equal groups
Number theory practice
Factoring algebraic expressions
Ratio and proportion problems

Common LCM and GCF Mistakes

Confusing factors with multiples.
Choosing a common factor that is not the greatest.
Choosing a common multiple that is not the least.
Using decimals in standard LCM/GCF problems.
Forgetting to include all input numbers.
Mishandling zero.
Assuming LCM is always the product of the numbers.
Missing repeated prime factors.

Frequently Asked Questions