GCD Calculator

Calculate the GCD (greatest common divisor) of two or more numbers at once, or see how the GCD relates to the LCM for a pair of numbers. No sign-up, instant results. Just need the LCM? Use the LCM calculator.

GCD Calculator

GCD 0

GCD and LCM relationship

GCD 0
LCM 0
A × B 0

What is the GCD

The GCD, or greatest common divisor, is the largest whole number that divides every number in a list with no remainder. For example, the GCD of 18 and 24 is 6, since 6 divides both numbers exactly and no larger common divisor exists between them.

How to calculate GCD by factorization

A traditional way to find the GCD is to break each number down into prime factors and multiply only the factors shared by all of them, each raised to the lowest exponent found. This calculator uses the Euclidean algorithm internally, which reaches the same result more directly, without needing to factor, and it also works for more than two numbers at once.

GCD and LCM: how they relate

For two numbers A and B, there is a simple relationship between the GCD and the LCM: GCD(A, B) × LCM(A, B) = A × B. This property only holds exactly for pairs of numbers, and it's a quick way to check a calculation, since multiplying the two results should match the product of the original numbers. If you only need the LCM, the LCM calculator handles that for any amount of numbers.

Practical example

An 18 by 24 meter plot of land will be split into equal squares, as large as possible, with no leftover space. The GCD of 18 and 24, which is 6, gives the side length of that square in meters.

Frequently asked questions

What is the GCD?

It's the largest whole number that divides every number given with no remainder. The GCD of 18 and 24, for example, is 6.

How do you find the GCD of more than two numbers?

Find the GCD of the first two, then the GCD of that result with the next number, repeating until the whole list is included.

How are the GCD and LCM related?

For two numbers, the product of the GCD and the LCM always equals the product of the two original numbers.