greatest common divisor Euclidean Algorithm to Calculate Greatest Common Divisor (GCD) of 2 numbers The Euclid's algorithm (or Euclidean Algorithm) is a method for efficiently finding the greatest common divisor (GCD) of two numbers. The GCD of two integers X and Y is the largest integer that divides both of X and Y (without leaving a remainder).