Skip to content
Math

GCF and LCM Calculator

Last updated: July 11, 2026

Find the Greatest Common Factor (GCF) and Least Common Multiple (LCM) of two or more numbers. Enter numbers separated by commas to see results with prime factorization.

How to Use This GCF and LCM Calculator

Follow these simple steps to find the GCF and LCM:

  1. Enter two or more positive integers in the input field, separated by commas.
  2. Click the "Calculate" button.
  3. View the GCF, LCM, and prime factorization of each number in the results section.

Formulas

The GCF and LCM are related by the following identity for two numbers a and b:

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

GCF is found by taking the lowest power of each common prime factor.

LCM is found by taking the highest power of each prime factor present in any number.

Example: 12 = 2² × 3, 18 = 2 × 3²
GCF = 2¹ × 3¹ = 6
LCM = 2² × 3² = 36

Examples

Example 1: Two Numbers

Find GCF and LCM of 12 and 18:
12 = 2² × 3, 18 = 2 × 3²
GCF = 6, LCM = 36

Example 2: Three Numbers

Find GCF and LCM of 8, 12, and 20:
8 = 2³, 12 = 2² × 3, 20 = 2² × 5
GCF = 4, LCM = 120

Example 3: Coprime Numbers

Find GCF and LCM of 7 and 13:
7 and 13 are both prime and share no common factors.
GCF = 1, LCM = 91

Frequently Asked Questions

What is the Greatest Common Factor (GCF)?

The Greatest Common Factor (GCF), also called the Greatest Common Divisor (GCD), is the largest positive integer that divides two or more numbers evenly without a remainder. For example, the GCF of 12 and 18 is 6, since 6 is the largest number that divides both 12 and 18.

What is the Least Common Multiple (LCM)?

The Least Common Multiple (LCM) is the smallest positive integer that is a multiple of two or more numbers. For example, the LCM of 4 and 6 is 12, since 12 is the smallest number divisible by both 4 and 6. LCM is commonly used when adding or subtracting fractions with different denominators.

How do you find prime factors of a number?

Prime factorization is the process of breaking a number down into its prime number factors. Start by dividing the number by the smallest prime (2) and continue dividing by primes until you reach 1. For example, 360 = 2³ × 3² × 5. Our calculator shows the prime factorization for each number you enter.

What is the difference between GCF and LCM?

GCF finds the largest factor shared by numbers (a "downward" operation), while LCM finds the smallest multiple shared by numbers (an "upward" operation). For any two numbers a and b: GCF(a,b) × LCM(a,b) = a × b. GCF is useful for simplifying fractions, while LCM is used for finding common denominators.

This calculator is for informational purposes only. Always consult a professional for critical mathematical or engineering applications.

Rate this calculator