GCF and LCM Calculator

Find the Greatest Common Factor (GCF) and Least Common Multiple (LCM) of two numbers. Includes step-by-step solutions using prime factorization.

Find GCF and LCM

Results

0
largest shared factor
0
smallest shared multiple
💡 Relationship: For any two numbers a and b: GCF(a,b) × LCM(a,b) = a × b

What is the Greatest Common Factor (GCF)?

The Greatest Common Factor (also called Greatest Common Divisor or GCD) is the largest positive integer that divides two or more numbers without leaving a remainder.

Example: The factors of 12 are 1, 2, 3, 4, 6, 12. The factors of 18 are 1, 2, 3, 6, 9, 18. The common factors are 1, 2, 3, 6. The GREATEST common factor is 6.

What is the Least Common Multiple (LCM)?

The Least Common Multiple is the smallest positive integer that is divisible by two or more numbers.

Example: Multiples of 12: 12, 24, 36, 48, 60... Multiples of 18: 18, 36, 54, 72... The LEAST common multiple is 36.

How to Find GCF Using Prime Factorization

  1. Find the prime factorization of each number.
  2. Identify the common prime factors.
  3. Multiply the common prime factors together (using the lowest power of each).
Example: GCF of 12 and 18
12 = 2 × 2 × 3 = 2² × 3
18 = 2 × 3 × 3 = 2 × 3²
Common factors: 2 × 3 = 6
GCF = 6

How to Find LCM Using Prime Factorization

  1. Find the prime factorization of each number.
  2. List all prime factors that appear in either number.
  3. For each prime factor, use the HIGHEST power that appears.
  4. Multiply these together.
Example: LCM of 12 and 18
12 = 2² × 3
18 = 2 × 3²
Highest powers: 2² and 3²
LCM = 2² × 3² = 4 × 9 = 36

The Euclidean Algorithm for GCF

For large numbers, the Euclidean Algorithm is faster than prime factorization:

  1. Divide the larger number by the smaller number.
  2. Take the remainder and divide the previous divisor by it.
  3. Repeat until the remainder is 0.
  4. The last non-zero remainder is the GCF.

Real-World Applications

  • Simplifying Fractions: Divide numerator and denominator by their GCF. (e.g., 12/18 ÷ 6/6 = 2/3).
  • Adding Fractions: Find the LCM of denominators to get a common denominator.
  • Scheduling: If Event A happens every 12 days and Event B every 18 days, they coincide every LCM(12,18) = 36 days.
  • Tiling: To tile a 12×18 floor with the largest possible square tiles, use tiles of size GCF(12,18) = 6.

GCF and LCM Relationship

For any two positive integers a and b:

GCF(a, b) × LCM(a, b) = a × b

This means if you know the GCF, you can easily find the LCM: LCM(a,b) = (a × b) / GCF(a,b)

References

  • Khan Academy. "Greatest Common Factor." 2024.
  • Math is Fun. "Least Common Multiple." 2024.