A little clarity, calculated.

culators

Math / Greatest Common Factor

Greatest Common Factor Calculator

Find the greatest common factor (greatest common divisor) shared by two integers. The result can reduce fractions, simplify ratios, or identify the largest equal grouping that divides both quantities evenly. Euclid’s algorithm repeatedly replaces (a,b) with (b,a mod b) until the remainder is zero; the last nonzero value is the greatest common factor.

Your inputs

Make it your own
Calculator settings

Your result
6
Greatest common factor

Example inputs shown. Adjust them to explore.

A familiar situation

Find the largest shared divisor when reducing a fraction or grouping items evenly.

How to use this calculator

  1. Enter first integer, second integer.
  2. Select Calculate to see the answer and its breakdown.
  3. Keep a scenario, change an input and compare the results.

Use consistent units and check the assumptions below before applying the result.

How greatest common factor is calculated

Euclid’s algorithm repeatedly replaces (a,b) with (b,a mod b) until the remainder is zero; the last nonzero value is the greatest common factor. For 84 and 30, gcd(84,30)=6, so both numbers are divisible by 6 and no larger common divisor exists.

gcd(a,b) is found by Euclid’s repeated remainder algorithm.
A worked example

For 84 and 30, gcd(84,30)=6, so both numbers are divisible by 6 and no larger common divisor exists.

Assumptions & useful context

The result depends on the values you enter and the method described above. Displayed numbers may be rounded; calculations use the unrounded values. Check that this model matches your situation before relying on it.

Frequently asked questions

Can one input be zero?

Yes, gcd(a,0)=|a| when a is nonzero.

Why reject two zeroes?

Every positive integer divides zero, so there is no greatest finite common factor.

Find a calculator