Boneyard Tools

GCD and LCM Calculator

Compute the greatest common divisor (GCD) and least common multiple (LCM) of any list of whole numbers at once. Type the numbers and the results update instantly.

How to find the GCD and LCM

  1. Type two or more integers, separated by commas or spaces.
  2. Read the GCD (greatest common divisor) from the first result card.
  3. Read the LCM (least common multiple) from the second result card.

Examples

Two numbers

12, 18
GCD = 6, LCM = 36

Three numbers

4, 6, 8
GCD = 2, LCM = 24

Frequently asked questions

What is the greatest common divisor (GCD)?

The GCD, also called the greatest common factor (GCF) or highest common factor (HCF), is the largest whole number that divides every number in the list with no remainder.

What is the least common multiple (LCM)?

The LCM is the smallest positive whole number that every number in the list divides into evenly. It is a common multiple of all of them.

How are the GCD and LCM calculated?

The GCD is found with the Euclidean algorithm, repeatedly taking remainders until one reaches zero. The LCM uses the identity lcm(a, b) = |a / gcd(a, b) * b|. For longer lists the calculator folds each result across the numbers two at a time.

Can I enter more than two numbers?

Yes. Enter as many integers as you like. The GCD and LCM are reduced across the whole list, so the answers apply to every number at once.

What are the GCD and LCM used for?

The GCD reduces fractions to lowest terms and simplifies ratios. The LCM finds common denominators and solves scheduling problems, such as when two repeating events line up again.

Why are zero and decimals rejected?

The tool works on non-zero integers. Every number is a multiple of zero and the GCD of all zeros is undefined, while decimals do not have a well-defined GCD or LCM.

Related tools