Greatest Common Divisor (GCD)
Compute the GCD of two positive integers using the Euclidean algorithm — matching the layout of our conversion calculators.
Positive integer
Positive integer
The Euclidean algorithm repeatedly replaces the larger number by its remainder when divided by the smaller number until one side reaches zero. The last non-zero value is the GCD.
gcd(a, b) = gcd(b, a mod b), with gcd(a, 0) = |a|. For coprime numbers, gcd = 1.
48 = 18 × 2 + 12 → gcd(48,18)=gcd(18,12). 18 = 12 × 1 + 6 → gcd(12,6). 12 = 6 × 2 + 0 → gcd is 6.
The greatest common divisor (GCD), also called greatest common factor (GCF), is the largest positive integer that divides both numbers without a remainder.
For two positive integers a and b: GCD(a,b) × LCM(a,b) = a × b. Use the LCM & HCF calculator when you need both values.
© 2026 PromathTools. All rights reserved.
Developed by kruskalcode.com