GCD (Greatest Common Divisor) Calculator

Euclidean algorithm: gcd(a,b) = gcd(b, a mod b). Supports 2-6 integers.

Inputs

Result

GCD
12
Of 48, 36.
  • Numbers48, 36
  • GCD12
  • Reduced48/12 = 4, 36/12 = 3

Step-by-step

  1. Apply Euclidean algorithm pairwise.
  2. gcd(48, 36) = 12.

How to use this calculator

  • Enter 2-4 positive integers.
  • Leave optional fields at 0 to ignore.

About this calculator

The GCD (greatest common divisor) of two integers is the largest number that divides both without remainder. The Euclidean algorithm runs gcd(a,b) = gcd(b, a mod b) until b=0, completing in O(log min(a,b)) steps. For 3+ numbers, GCD is associative: gcd(a,b,c) = gcd(gcd(a,b),c). Common use: simplifying fractions (48/36 → divide by gcd 12 → 4/3), and finding shared periods in problems involving multiple cycles.

Frequently asked

GCD = greatest common factor (divides both). LCM = smallest common multiple (both divide it). Linked by gcd(a,b) × lcm(a,b) = a×b.

Related calculators