LCM and GCD Calculator

Enter numbers separated by commas (e.g., 12, 18, 24)

Example: 8, 12 → LCM = 24, GCD = 4

Least Common Multiple (LCM) 0
Greatest Common Divisor (GCD) 0

What is LCM and GCD Calculator?

LCM (Least Common Multiple):

The Least Common Multiple (LCM) of two or more numbers is the smallest positive number that is a multiple of all the given numbers. In simple words, it’s the smallest number into which each of the numbers can divide evenly without leaving a remainder.

Example:
Find the LCM of 4 and 5.

  • Multiples of 4: 4, 8, 12, 16, 20, 24, …

  • Multiples of 5: 5, 10, 15, 20, 25, …

  • The smallest common multiple is 20.
    So, LCM(4, 5) = 20.

GCD (Greatest Common Divisor):

The Greatest Common Divisor (GCD), also called the Greatest Common Factor (GCF), of two or more numbers is the largest positive number that divides each of the numbers exactly (without leaving a remainder).

Example:
Find the GCD of 12 and 18.

  • Factors of 12: 1, 2, 3, 4, 6, 12

  • Factors of 18: 1, 2, 3, 6, 9, 18

  • The greatest common factor is 6.
    So, GCD(12, 18) = 6.


Difference Between LCM and GCD:

FeatureLCM (Least Common Multiple)GCD (Greatest Common Divisor)
MeaningSmallest common multiple of given numbersLargest common factor of given numbers
PurposeFind a number both/all can divide intoFind the largest number that divides both/all
ExampleLCM of 4 and 5 is 20GCD of 12 and 18 is 6

What is the Least Common Multiple (LCM)?

In mathematics, the least common multiple, also known as the lowest common multiple of two (or more) integers a and b, is the smallest positive integer that is divisible by both. It is commonly denoted as LCM(a, b).

Brute Force Method

There are multiple ways to find a least common multiple. The most basic is simply using a “brute force” method that lists out each integer’s multiples.

Example: Find LCM(18, 26)

  • 18: 18, 36, 54, 72, 90, 108, 126, 144, 162, 180, 198, 216, 234
  • 26: 52, 78, 104, 130, 156, 182, 208, 234

As can be seen, this method can be fairly tedious, and is far from ideal.

Prime Factorization Method

A more systematic way to find the LCM of some given integers is to use prime factorization. Prime factorization involves breaking down each of the numbers being compared into its product of prime numbers.
The LCM is then determined by multiplying the highest power of each prime number together. Note that computing the LCM this way, while more efficient than using the “brute force” method, is still limited to smaller numbers. Refer to the example below for clarification on how to use prime factorization to determine the LCM:

Example: Find LCM(21, 14, 38)

  • 21 = 3 × 7
  • 14 = 2 × 7
  • 38 = 2 × 19

The LCM is therefore: 3 × 7 × 2 × 19 = 798

Greatest Common Divisor Method

A third viable method for finding the LCM of some given integers is using the greatest common divisor. This is also frequently referred to as the greatest common factor (GCF), among other names.
Refer to the link for details on how to determine the greatest common divisor. Given LCM(a, b), the procedure for finding the LCM using GCF is to divide the product of the numbers a and b by their GCF, i.e. (a × b)/GCF(a, b).
 When trying to determine the LCM of more than two numbers, for example LCM(a, b, c), find the LCM of a and b where the result will be q. Then find the LCM of c and q. The result will be the LCM of all three numbers. Using the previous example:

Example: Find LCM(21, 14, 38)

  • GCF(14, 38) = 2
  • LCM(14, 38) = (38 × 14)/2 = 266
  • GCF(266, 21) = 7
  • LCM(266, 21) = (266 × 21)/7 = 798

LCM(21, 14, 38) = 798

Note that it is not important which LCM is calculated first as long as all the numbers are used, and the method is followed accurately. Depending on the particular situation, each method has its own merits, and the user can decide which method to pursue at their own discretion.

Related Calculator:
Greatest Common Factor Calculator, Factor Calculator, Rounding Calculator 

External Resources:

Least Common Multiple Calculator on Calculator.net

Advertisement

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top