GCD Calculator (Greatest Common Divisor)

Up to 15 whole numbers, separated by commas or spaces.
Math Updated 30 Oct 2026

Finds the greatest common divisor (GCD), also called the greatest common factor (GCF) or highest common factor (HCF), of up to 15 whole numbers: the largest number that divides all of them without a remainder. Enter the numbers separated by commas or spaces and choose how to see the working: the Euclidean algorithm step by step, or the prime factorization of each number with the shared factors picked out. The least common multiple is shown too.

  • Inputs are whole numbers up to 10¹²; signs are ignored.

Formula

Euclid: GCD(a, b) = GCD(b, a mod b), until the remainder is 0; GCD(a, b, c) = GCD(GCD(a, b), c)
  • With prime factorizations, the GCD is the product of the primes common to all numbers, each raised to its smallest exponent.
  • GCD × LCM = a × b for two positive numbers.
  • Negative signs are ignored; GCD(n, 0) = n.
  • Numbers up to 1,000,000,000,000 are accepted.

GCD of 48, 180 and 300

Inputs
  • Numbers: 48, 180, 300
  • Show the working by: euclid

180 = 3 × 48 + 36, 48 = 1 × 36 + 12, 36 = 3 × 12 + 0, so GCD(48, 180) = 12. Then 300 = 25 × 12 + 0, so the GCD of all three is 12. Check: 48 = 2⁴ × 3, 180 = 2² × 3² × 5, 300 = 2² × 3 × 5²; shared factors 2² × 3 = 12.

Sources & references

  • Euclidean algorithm
    Wikipedia · Retrieved 30 Oct 2026

    GCD(a, b) = GCD(b, a mod b); example GCD(252, 105) = 21.

Frequently asked questions

What is the GCD?
The greatest common divisor of two or more whole numbers is the largest number that divides each of them exactly. GCD(12, 18) = 6.
Is GCD the same as GCF and HCF?
Yes. Greatest common divisor, greatest common factor and highest common factor are three names for the same thing.
How does the Euclidean algorithm work?
Replace the larger number by the remainder when it is divided by the smaller, and repeat. When the remainder reaches 0, the other number is the GCD. For 252 and 105: 252 = 2 × 105 + 42, 105 = 2 × 42 + 21, 42 = 2 × 21 + 0, so the GCD is 21.
What does it mean if the GCD is 1?
The numbers are coprime (relatively prime): they share no factor other than 1, such as 8 and 15.

Related calculators