Least Common Multiple Calculator

Find the least common multiple (LCM) of two or more numbers instantly. Includes prime factorization breakdown, GCD, and step-by-step working. Useful for adding fractions and solving scheduling problems.

Share:
LCM Calculator
LCM = (a × b) / GCD(a, b)

Least Common Multiple

36

LCM(12, 18)

Greatest Common Divisor (GCD)

6

GCD(12, 18)

Prime Factorization
12 =2^2 × 3
18 =2 × 3^2
LCM = 2^2 × 3^2 =36

What Is the Least Common Multiple?

The least common multiple (LCM) of two or more integers is the smallest positive integer that is divisible by all of them. For example, the LCM of 4 and 6 is 12, because 12 is the smallest number that both 4 and 6 divide into evenly.

LCM is widely used when adding or subtracting fractions, scheduling repeating events, and solving problems in number theory. It is closely related to the greatest common divisor (GCD), and the two can be computed together efficiently.

What This Calculator Does

This calculator finds the LCM of two or more positive integers. It also computes the GCD and provides a full prime factorization breakdown showing exactly how the LCM is constructed. You can add as many numbers as needed.

  • Inputs: Two or more positive integers
  • Outputs: LCM, GCD, prime factorization of each number, and step-by-step LCM construction

How the Calculation Works

Method 1: Using GCD

LCM(a, b) = |a × b| / GCD(a, b)

The GCD (greatest common divisor) is found using the Euclidean algorithm, which is fast and reliable. Dividing the product of two numbers by their GCD gives their LCM. For more than two numbers, apply this formula pairwise from left to right.

Method 2: Prime Factorization

Factor each number into its prime factors. For each unique prime, take the highest power that appears in any of the numbers. Multiply these together to get the LCM.

Example: LCM(12, 18). 12 = 2² × 3. 18 = 2 × 3². LCM uses the highest powers: 2² × 3² = 4 × 9 = 36.

The Euclidean Algorithm for GCD

GCD(a, b) = GCD(b, a mod b) until b = 0

This iterative algorithm repeatedly replaces the larger number with the remainder of division until the remainder is zero. The last non-zero value is the GCD. It is efficient even for very large numbers.

How to Use the Calculator

  1. Enter your first positive integer in the first field
  2. Enter your second integer in the second field
  3. Click "Add another number" if you need the LCM of three or more numbers
  4. The LCM, GCD, and prime factorization update instantly
  5. Remove extra numbers using the X button next to each input

Example Calculations

Example 1: Two Numbers

LCM(8, 12). GCD(8, 12) = 4. LCM = (8 × 12) / 4 = 96 / 4 = 24. Verify: 24 / 8 = 3, 24 / 12 = 2. Both divide evenly, and no smaller number does.

Example 2: Three Numbers

LCM(4, 6, 10). Factorizations: 4 = 2², 6 = 2 × 3, 10 = 2 × 5. Highest powers: 2² × 3 × 5 = 60. Check: 60/4 = 15, 60/6 = 10, 60/10 = 6. All divide evenly.

Example 3: Coprime Numbers

LCM(7, 11). Since 7 and 11 share no common factors, GCD = 1, so LCM = 7 × 11 = 77. When two numbers share no common factors (they are coprime), their LCM equals their product.

Real-World Scenarios

Adding Fractions

To add 1/4 + 1/6, you need a common denominator. LCM(4, 6) = 12. Rewrite as 3/12 + 2/12 = 5/12. The LCM gives the smallest common denominator, which keeps fractions in their simplest form during arithmetic.

Scheduling and Cycles

If Event A happens every 4 days and Event B every 6 days, LCM(4, 6) = 12 tells you both events coincide every 12 days. This applies to traffic light synchronization, gear rotation cycles, manufacturing processes, and recurring meeting schedules.

Music and Rhythm

In music, when two rhythmic patterns with different beat counts need to synchronize, the LCM determines when both patterns return to their starting position simultaneously. A pattern of 3 beats and one of 4 beats align every LCM(3, 4) = 12 beats.

Why This Calculation Matters

LCM is fundamental to arithmetic with fractions, which appears constantly in math, science, cooking, and construction. Beyond fractions, the LCM solves a class of real-world scheduling and synchronization problems that arise whenever repeating cycles must be aligned.

Common Mistakes to Avoid

  • Confusing LCM with GCD: LCM is the smallest number both divide into; GCD is the largest number that divides both. They serve different purposes
  • Using zero or negative numbers: LCM is defined for positive integers only. Zero and negatives require special handling and are not meaningful in most LCM applications
  • Thinking LCM always equals the product: LCM equals the product only when the two numbers are coprime (GCD = 1). For numbers sharing common factors, LCM is smaller than the product
  • Not simplifying fractions before finding LCM: When working with fractions that can be reduced, simplify them first. This often results in smaller denominators and easier arithmetic

Frequently Asked Questions

Embed This Calculator

Least Common Multiple Calculator

Calculate
Reset