Enter gcd calculator values

Enter first integer.
Enter second integer.
GCD
6

GCD is 6.

Summary

Find the greatest common divisor of two integers.

Calculation details

GCD(0, 0) is rejected as undefined here. Calculations retain raw JavaScript number precision; display values are rounded to at most six decimal places.

Formula

Euclidean algorithm: repeatedly replace (a, b) with (b, a mod b).

Worked example

GCD Calculator example

GCD is 6.

How it works

Enter two integers. GCD(0,0) is rejected as undefined in this tool.

Frequently asked questions

How accurate is the GCD Calculator?

The calculation keeps raw numeric precision and rounds only the displayed result to at most six decimal places.

What should I do with an invalid result?

Check that every visible value is finite and that no required divisor is zero.

Related calculators