FREE · INSTANT RESULT · WITH THE FORMULA
Home / Math / GCF and LCM Calculator
Math · GCF and LCM

GCF and LCM Calculator

Find the greatest common factor (GCF) and least common multiple (LCM) of two whole numbers.

GCF
6
LCM
72
LCM = a × b ÷ GCF

TL;DR: A GCF and LCM calculator finds the largest number that divides into a set of integers and the smallest number that is a multiple of them.

  • GCF (Greatest Common Factor): The largest positive integer that divides each of the numbers without a remainder.
  • LCM (Least Common Multiple): The smallest positive integer that is a multiple of all the numbers.
  • Calculation Methods: Common manual methods include prime factorization, listing multiples, and the Euclidean algorithm.
  • Key Relationship: The product of two numbers equals the product of their GCF and LCM: a × b = GCF(a, b) × LCM(a, b).
  • Alternative Names: GCF is also called the Greatest Common Divisor (GCD) or the Highest Common Factor (HCF).

What Are GCF and LCM?

The Greatest Common Factor (GCF) is the largest positive integer that divides evenly into all numbers in a given set, while the Least Common Multiple (LCM) is the smallest positive integer that is a multiple of every number in that set. For example, the GCF of 12 and 18 is 6, because 6 is the largest number that divides both 12 and 18. The LCM of 12 and 18 is 36, because 36 is the smallest number that is a multiple of both 12 (12 x 3) and 18 (18 x 2).

These two values are fundamental concepts in number theory. The GCF is always less than or equal to the smallest number in the set. Conversely, the LCM is always greater than or equal to the largest number in the set. The term GCF is interchangeable with Greatest Common Divisor (GCD) and Highest Common Factor (HCF); they all refer to the same value.

How to Calculate the GCF Manually

The most common manual method to find the GCF of two or more numbers is by using prime factorization. This process involves breaking down each number into its prime factors and identifying the factors they share.

Follow these steps to find the GCF using prime factorization:

  • Step 1: Find the prime factors. List the prime factors of each number in the set. For example, to find the GCF of 36 and 54, their prime factorizations are 36 = 2 × 2 × 3 × 3 and 54 = 2 × 3 × 3 × 3.
  • Step 2: Identify common factors. Find all the prime factors that appear in the factorization of every number. In this case, both numbers share one "2" and two "3"s.
  • Step 3: Multiply the common factors. Multiply these shared prime factors together to get the GCF. For 36 and 54, the GCF is 2 × 3 × 3 = 18.

For smaller numbers, you can also list all the factors (divisors) of each number and find the largest one they have in common.

How to Calculate the LCM Manually

To find the LCM manually, you can use the prime factorization method, which is efficient for larger numbers. This method requires finding the prime factors of each number and using the highest power of each factor present in any of the factorizations.

To calculate the LCM using prime factorization:

  • Step 1: Find the prime factors. Break down each number into its prime factors, preferably using exponential notation. Using the numbers 36 and 54 again: 36 = 2² × 3² and 54 = 2¹ × 3³.
  • Step 2: Identify all unique prime factors. List every unique prime factor that appears in any of the factorizations. Here, the factors are 2 and 3.
  • Step 3: Find the highest power of each factor. For each unique prime factor, find the highest exponent it has in any of the factorizations. The highest power of 2 is 2² (from 36), and the highest power of 3 is 3³ (from 54).
  • Step 4: Multiply the highest powers. Multiply these highest-power factors together to get the LCM. For 36 and 54, the LCM is 2² × 3³ = 4 × 27 = 108.

An alternative for smaller numbers is to list the multiples of each number until you find the first common multiple.

The Relationship Between GCF and LCM

The product of two integers is equal to the product of their GCF and LCM. This relationship provides a simple way to find one value if you already know the other. The formula is expressed as: GCF(a, b) × LCM(a, b) = a × b.

This formula can be rearranged to find the LCM or GCF quickly. For example, if you need the LCM of two numbers, you can first find their GCF and then use the formula LCM(a, b) = (a × b) / GCF(a, b). Using the numbers 12 and 18, we know their GCF is 6. Applying the formula, the LCM = (12 × 18) / 6 = 216 / 6 = 36. This method is often faster than prime factorization for finding the LCM once the GCF is known.

GCF vs. LCM: Key Differences

The GCF is about division and finding the largest shared factor, while the LCM is about multiplication and finding the smallest shared multiple. The GCF helps break things down into smaller, equal parts, whereas the LCM helps find when cycles or events will align.

FeatureGreatest Common Factor (GCF)Least Common Multiple (LCM)
DefinitionThe largest number that divides into all given numbers.The smallest number that is a multiple of all given numbers.
ValueAlways less than or equal to the smallest number in the set.Always greater than or equal to the largest number in the set.
ApplicationSimplifying fractions, factoring polynomials, grouping items.Finding a common denominator, solving scheduling problems.
Example (20, 30)1060

When to Use GCF and LCM

GCF is used for problems involving simplification or distribution of items into the largest possible identical groups. For example, if you have 40 pencils and 32 notebooks and want to create identical supply kits with no items left over, the GCF (8) tells you the maximum number of kits you can make.

LCM is used to find a common point in the future for events that occur in cycles. A common application is finding a common denominator when adding or subtracting fractions. Another example involves scheduling: if one person has a day off every 4 days and another has a day off every 6 days, the LCM (12) tells you they will have a day off together every 12 days.

Frequently Asked Questions

How do you find the GCF and LCM of three numbers? Using prime factorization, find the prime factors for all three numbers. For the GCF, multiply only the prime factors common to all three numbers, using the lowest power. For the LCM, multiply every unique prime factor from all numbers, using the highest power that appears in any factorization.

Can the GCF be larger than the LCM? No, the GCF of a set of positive integers is always less than or equal to their LCM. They are only equal if all the numbers in the set are identical (e.g., the GCF and LCM of 7, 7, and 7 is 7).

What is the difference between GCF, HCF, and GCD? There is no mathematical difference. GCF (Greatest Common Factor), HCF (Highest Common Factor), and GCD (Greatest Common Divisor) are different regional or stylistic terms for the exact same concept.

What is the GCF of a prime number and another number? If the other number is a multiple of the prime number, the GCF is the prime number itself. If the other number is not a multiple of the prime, their GCF is 1, meaning they are coprime.