Calcist

Style

Buttons

Spacing

How much to show

Decimal places

Text size

GCF calculator

Enter two or more whole numbers to find their greatest common factor, also called the greatest common divisor (GCD) or highest common factor (HCF).

Private: calculated on your device. Nothing you type is sent anywhere.

Next: Need the smallest shared multiple? Use the LCM calculator. Simplifying a fraction? Try the decimal to fraction converter (it simplifies too).

How the GCF is calculated

The calculator uses the Euclidean algorithm, the method in Euclid's Elements from about 300 BC. Divide the bigger number by the smaller, keep the remainder, and repeat with the smaller number and the remainder. When the remainder is 0, the last divisor is the GCF.

GCF(a, b) = GCF(b, a mod b), and GCF(a, 0) = a

For more than two numbers, work in pairs: GCF(a, b, c) = GCF(GCF(a, b), c).

Worked example: 1071 and 462

1071 = 2 × 462 + 147
462 = 3 × 147 + 21
147 = 7 × 21 + 0

The last nonzero remainder is 21, so GCF(1071, 462) = 21. Check with prime factors: 1071 = 3² × 7 × 17 and 462 = 2 × 3 × 7 × 11. The primes they share are 3 and 7, each with its lowest power, and 3 × 7 = 21.

Where the GCF is used

  • Simplifying fractions. Divide the top and bottom by their GCF: 18/24 has GCF 6, so it simplifies to 3/4. The decimal to fraction converter (it simplifies too) does this too.
  • Splitting into equal groups. With 48 apples and 180 oranges, the largest number of identical gift bags with nothing left over is GCF(48, 180) = 12.
  • Factoring in algebra. 12x + 18 = 6(2x + 3), because GCF(12, 18) = 6.

When this doesn't apply

  • The GCF is for whole numbers. Negative signs are ignored, and the answer is always positive.
  • GCF(a, 0) = a, because every number divides 0. A list of only zeros has no GCF.
  • A GCF of 1 doesn't mean a mistake. It means the numbers are relatively prime (coprime), like 8 and 15.

Sources

How we checked this

Before every update, this calculator is run in a real browser with these known answers, and it must match all of them:

  • '1,000, 250' is read as 1000 and 250: GCF 250 ✓
  • GCF of 12, 18 and 30 = 6 ✓
  • Euclid's steps for 1071 and 462 (GCF 21) ✓
  • 17 and 31 are relatively prime (GCF 1) ✓
  • 0 and 0 have no GCF ✓

Last checked October 26, 2026. Spotted something wrong? The math is done in your browser with the formula shown on this page, so you can check any result by hand.

Add this calculator to your website (free)

Paste this code into any web page. The calculator works on your page, resizes itself, has no ads and no tracking, and nothing your visitors type is sent anywhere. More about embedding.

Questions people ask

What is the GCF of 12 and 18?

6. The factors of 12 are 1, 2, 3, 4, 6, 12, and the factors of 18 are 1, 2, 3, 6, 9, 18. The biggest one in both lists is 6.

Are GCF, GCD and HCF the same thing?

Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number.

What does it mean if the GCF is 1?

The numbers share no factor other than 1. They're called relatively prime or coprime, even if neither number is prime, like 8 and 9.

How do I find the GCF of three numbers?

Find the GCF of two of them, then the GCF of that answer and the third. GCF(12, 18, 30): GCF(12, 18) = 6, then GCF(6, 30) = 6.

Related calculators