Math

GCF calculator

Find the greatest common factor of 2 to 6 whole numbers. This is also called the greatest common divisor.

Free to useNo sign-upCalculated in your browser

Greatest common factor

A whole number from 1 to 1,000,000,000.

A whole number from 1 to 1,000,000,000.

Your numbers stay in this browser.

Greatest common factor

Enter 2 to 6 whole numbers. The result is the largest positive integer that divides every one of them.

What the greatest common factor is

The greatest common factor of a set of whole numbers is the largest positive integer that divides every number in the set. It is also called the greatest common divisor. For 24 and 36, that number is 12: 12 divides both, and 13 does not divide either.

OpenStax Prealgebra treats a factor as a whole number that divides another whole number with no remainder.

Euclid’s algorithm

The page does not search downward from the smaller number. Euclid’s algorithm replaces the pair with the remainder. For 24 and 36, 36 divided by 24 leaves 12, and 24 divided by 12 leaves 0. The last nonzero remainder is 12.

For more than two numbers, the same step is repeated. The greatest common factor of 8, 12, and 20 is the greatest common factor of 8 and 12, which is 4, and then of 4 and 20, which is still 4. The order of the inputs does not change the result. Repeating a number does not change it either: the greatest common factor of 9 and 9 is 9. Two numbers with no common factor greater than 1, such as 17 and 29, have greatest common factor 1.

With exactly two numbers, the page also reduces their ratio. 24:36 divided by 12 is 2:3. That reduced ratio is not shown for three or more numbers, because a single ratio is a two-number statement.

What this page does not do

It does not find the least common multiple. That question is on the LCM calculator. It does not add fractions. That question is on the fraction calculator. A ratio of two quantities that are not these integers belongs on the ratio calculator.

Each input must be a whole number from 1 to 1,000,000,000. Zero, a negative, a decimal, a comma, and scientific notation are rejected rather than coerced.

Frequently asked questions

Is the GCF the same as the GCD? Yes. Greatest common factor and greatest common divisor name the same positive integer on this page.

Can the factor be larger than one of the numbers? No. A common factor cannot be larger than the smallest positive input.

Are these numbers sent to analytics? No. Analytics may record that this calculator ran. The numbers and the factor stay in this browser.

Sources & review

Last reviewed: . The formula is reproduced above so you can check the math independently.

How we check calculations and describe their limits

Exact integer arithmetic for the numbers you enter. Not a prime factorization worksheet.

Accessibility and student privacy

Our accessibility target is WCAG 2.1 AA. We use automated checks for keyboard operation, narrow layouts and readable alternatives to charts. Keyboard and screen reader behavior can vary by device and browser.Report an accessibility issue.

These tools have no ads, affiliate offers or sponsored content. No account is needed. Calculations run in your browser; your inputs and results are not sent to us or to analytics. Google Analytics may be used to measure site usage. See Privacy & analytics for details and how to turn it off.