GCD calculator (greatest common divisor)

Type two or more whole numbers. We find the largest number that divides them all and show every step.

GCD calculator (greatest common divisor)

Separated by spaces, commas or “;”. e.g. 48; 18

Result

6GCD

48 = 2 × 18 + 12
18 = 1 × 12 + 6
12 = 2 × 6 + 0

GCD calculator (greatest common divisor)

Inputs

Your whole numbers
48; 18

How it is calculated

Divide the larger number by the smaller one and keep the remainder.

Result

GCD

6

How it is calculated

  1. Divide the larger number by the smaller one and keep the remainder.
  2. Repeat with the smaller number and that remainder.
  3. When the remainder is 0, the last divisor is the GCD: GCD(a, b) = GCD(b, a mod b).
  4. For more than two numbers: GCD(a, b, c) = GCD(GCD(a, b), c).

Example

GCD(48, 18): 48 = 2 × 18 + 12, 18 = 1 × 12 + 6, 12 = 2 × 6 + 0. The GCD is 6.

Good to know

  • Only whole numbers are accepted. The minus sign is ignored: GCD(−12, 18) = 6.
  • Up to 50 numbers of 200 digits each, computed exactly.

Frequently asked questions

What is this tool used for?

Type two or more whole numbers. We find the largest number that divides them all and show every step.

How is the result calculated?

Divide the larger number by the smaller one and keep the remainder.

What should I check before using the result?

Only whole numbers are accepted. The minus sign is ignored: GCD(−12, 18) = 6.

Updated October 10, 2026

Indicative result. For an important decision, check with a professional.