Divisor, Common Divisors, and Greatest Common Divisor Calculator

Updated 14 November 2026

A common divisor divides both numbers with no remainder. The greatest common divisor (GCD), also called the highest common factor (HCF), is the largest of their common positive factors.

Common factors, GCD, and LCM

Enter two positive integers up to 1,000,000,000. GCD is also called HCF (highest common factor).

Greatest common divisor
Least common multiple

All common positive factors

Common factors and multiples

\[\gcd(a,b)\times\operatorname{lcm}(a,b)=a\times b\]

This identity applies to positive integers \(a\) and \(b\). GCD finds the largest shared factor; LCM finds the smallest shared positive multiple.

Example: common factors of 12 and 18

Factors of 12: 1, 2, 3, 4, 6, 12.
Factors of 18: 1, 2, 3, 6, 9, 18.

The shared factors are 1, 2, 3, 6. The largest is 6.

\[\gcd(12,18)=6\]

The LCM is \((12\times18)\div6=36\).

A faster method: Euclid's algorithm

GCD of 48 and 18

Divide the larger number by the smaller and keep the remainder. Repeat with the previous divisor and remainder.

\[48=2\times18+12\]
\[18=1\times12+6\]
\[12=2\times6+0\]

The last nonzero remainder is 6, so \(\gcd(48,18)=6\).

Why is GCD useful?

Divide the numerator and denominator of a fraction by their GCD to simplify it:

\[\frac{12}{18}=\frac{12\div6}{18\div6}=\frac23\]

If the GCD is 1, the numbers are coprime. They need not both be prime: 8 and 15 are coprime even though both are composite.

Find the divisors of one number

Here “divisors” means positive whole-number divisors. Zero has infinitely many positive divisors, so these tools accept positive integers only.

Divisor finder

Enter a positive integer from 1 to 1,000,000,000. See every positive factor, its factor pairs, and its prime factorization.

Classification

Positive factors

Prime factorization

Factor pairs

Practice

Find the GCD and LCM of 24 and 36. What are their common factors?

Check the answer

GCD: 12. LCM: 72. Common factors: 1, 2, 3, 4, 6, 12.

See the factorization lesson for more factor pairs and prime factors.