GCF Calculator

Greatest common factor (GCF/GCD)
Next

The greatest common factor, also called GCD or HCF, is the biggest integer that divides every number in a set without remainder. Enter two or more positive integers and this calculator returns their greatest common factor right away, computed with the Euclidean algorithm. Use the result to check homework or to simplify a fraction like 84/144 down to 7/12.

How to compute the GCF

  1. 1

    Enter integers

    Two or more positive integers, separated by commas, spaces or new lines.

  2. 2

    The tool applies the Euclidean algorithm

    Repeatedly replaces (a, b) with (b, a mod b) until the remainder is zero.

  3. 3

    Read the GCF

    The result shown is the greatest common factor of your numbers, computed with the Euclidean algorithm.

Euclidean algorithm

To find gcd(a, b) where a ≥ b > 0:

while b ≠ 0:
    (a, b) ← (b, a mod b)
return a

For more than two numbers, apply the identity gcd(a, b, c) = gcd(gcd(a, b), c).

Worked example: GCF(84, 144)

Step Division Remainder
1 144 ÷ 84 = 1 r 60 60
2 84 ÷ 60 = 1 r 24 24
3 60 ÷ 24 = 2 r 12 12
4 24 ÷ 12 = 2 r 0 0

The last non-zero remainder is 12, so gcd(84, 144) = 12, and 84/144 simplifies to 7/12.

When the GCF is 1

If gcd(a, b) = 1, the numbers are coprime (relatively prime). 15 and 28 are coprime even though neither is prime; that property is what makes 15/28 impossible to reduce further.

Relation to LCM

gcd(a, b) × lcm(a, b) = |a × b|. So once you have one, you have the other for free.

Common use cases

  • Simplifying fractions to lowest terms.
  • Finding the largest identical tile size that covers a rectangle.
  • Reducing gear ratios and pulley diameters.
  • Modular arithmetic, coprime pairs are invertible modulo each other.

Frequently Asked Questions

They are three names for the same quantity. GCF (greatest common factor) is common in US schools, GCD (greatest common divisor) in maths and CS, HCF (highest common factor) in UK curricula.

It skips them: only positive integers are included in the calculation. To include a negative number, enter its absolute value instead, for example 84 for -84.

It is n (for positive n). Zero is divisible by every integer, so the largest common divisor with n is n itself. gcd(0, 0) is usually defined as 0.

No, the numbers are not stored. They are sent to our server only to compute the result, and while you move through the funnel steps they may also appear in the page link.

Related Tools

Tool available in other languages