Math calculator

Greatest Common Divisor Calculator

Find the greatest positive integer that divides two whole numbers.

✓ Tested formula✓ Instant result✓ Private by design
01
Enter your valuesResults update instantly as you type.

Your numbers stay on this device.

Understand the answer

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

  1. Enter the values using the labels and units shown.
  2. Review the live result and supporting details.
  3. Check the formula, example and assumptions before using the answer.

Assumptions and limits

  • Inputs are treated as integers.

Reference

Formula reviewed 2026-07-15

↑↓ Navigate · Enter Open · Esc Close