Formula and method
FormulaEuclid’s algorithm repeatedly replaces (a,b) with (b, a mod b) until b is zero.
The final non-zero remainder is the greatest common divisor shared by both integers.
Worked example
gcd(84,30) = 6.
How to use this calculator
- Enter the values using the labels and units shown.
- Review the live result and supporting details.
- Check the formula, example and assumptions before using the answer.
Assumptions and limits
- Inputs are treated as integers.
Reference
Formula reviewed 2026-07-15