Greatest Common Factor calculator

Find the largest positive integer that divides each input.

Greatest common factor
12

3 input integers.

Breakdown & share
Greatest common factor
12
Estimates only.

Your inputs

Example values. Change any of them.

How it’s worked out

See how we got 12

Use the Euclidean algorithm gcd(a,b) = gcd(b, a mod b). Common factors are precisely the factors of the greatest common divisor.

  1. Run the Euclidean algorithm across the input numbers.
  2. The last nonzero remainder gives the common divisor.

About this calculator

Signs do not affect the GCF or LCM of the input magnitudes.

Worked example

Greatest common factor · 12

Use the Euclidean algorithm gcd(a,b) = gcd(b, a mod b). Common factors are precisely the factors of the greatest common divisor.

  1. Run the Euclidean algorithm across the input numbers.
  2. The last nonzero remainder gives the common divisor.

Formula sources

Reference checked November 22, 2026.