Boneyard Tools

LCM and GCD Calculator

Enter two or more whole numbers to find their greatest common divisor (GCD) and least common multiple (LCM) at once. Handles any count of integers, including zeros.

How to find the GCD and LCM

  1. Enter your integers separated by commas or spaces.
  2. Read the GCD (largest number dividing all of them) and LCM (smallest number they all divide into).
  3. Copy either result.

Examples

GCD of 12 and 18

12, 18
GCD 6, LCM 36

LCM of 2, 3, 4

2, 3, 4
GCD 1, LCM 12

Frequently asked questions

What is the difference between GCD and LCM?

The GCD is the largest integer that divides every number, while the LCM is the smallest positive integer that every number divides into evenly.

How is the GCD calculated?

This tool uses Euclid's algorithm, repeatedly replacing the larger number with its remainder until one value reaches zero. The other value is the GCD.

Can I enter more than two numbers?

Yes. Enter as many integers as you like and the calculator folds the GCD and LCM across the whole list.

What happens if I include zero?

The GCD with zero ignores it, while any LCM that includes zero is defined as zero, which the tool reports accordingly.

Is HCF the same as GCD?

Yes. Highest common factor (HCF) is just another name for the greatest common divisor (GCD).

Related tools