Greatest Common Divisor (GCD) Calculator

Find the largest positive integer that divides two integers exactly.

Inputs

Result

Formula and assumptions

Apply Euclid’s algorithm, replacing the larger pair with the divisor and remainder until the remainder is zero.

Negative inputs are treated by magnitude. The divisor of two zeros is undefined here.

Worked example

First integer = -84, Second integer = 36. Result = 12.

Related tool Fractions Calculator.