CalcFolio

GCF Calculator

This GCF calculator finds the greatest common factor of 2 to 10 whole numbers: the largest number that divides all of them with no remainder. It is also called the greatest common divisor (GCD) or highest common factor (HCF). You see every division of the Euclidean algorithm, each number's prime factorization and whether the numbers are coprime, so you can check homework or simplify a fraction in one step.

Updated

Separate with commas or new lines

How to use the calculator

  1. Type your numbers separated by commas or on separate lines, for example 24, 36, 60. Use 2 to 10 positive whole numbers up to 1,000,000,000,000,000 (10¹⁵).
  2. Read the GCF and its prime factorization, together with the factorization of each number you entered.
  3. Check the steps. The table lists each division of the Euclidean algorithm, pair by pair.
  4. Look at "Coprime". It says yes when the only common factor is 1.

How the GCF is calculated

Euclidean algorithm

Divide the larger number by the smaller one and keep the remainder: a = q × b + r. Any number that divides a and b also divides r, so the GCF doesn't change when you replace the pair (a, b) with (b, r). Repeat until the remainder is 0. The last nonzero remainder is the GCF. Euclid described this method in Book VII of the Elements, and the number of steps stays small even for very large numbers.

For three or more numbers, the calculator works in steps: gcd(a, b, c) = gcd(gcd(a, b), c). All arithmetic is exact, with no rounding, even for 15-digit inputs.

Prime factorization check

The same answer comes from the prime factorizations: keep only the primes that appear in every number, each with its lowest exponent. 24 = 2³ × 3, 36 = 2² × 3² and 60 = 2² × 3 × 5 share 2² and 3, so the GCF is 2² × 3 = 12. The least common multiple is shown too, for reference.

Worked examples

1. GCF of 24, 36 and 60

PairDivision
gcd(36, 24)36 = 1 × 24 + 12
gcd(36, 24)24 = 2 × 12 + 0
gcd(60, 12)60 = 5 × 12 + 0

The GCF is 12. In practice: with 24 pencils, 36 erasers and 60 stickers, you can make at most 12 identical kits with nothing left over, each holding 2 pencils, 3 erasers and 5 stickers.

2. Euclid's classic: 1,071 and 462

1,071 = 2 × 462 + 147, then 462 = 3 × 147 + 21, then 147 = 7 × 21 + 0. The GCF is 21 (3 × 7). Factoring confirms it: 1,071 = 3² × 7 × 17 and 462 = 2 × 3 × 7 × 11.

3. Simplifying a fraction

To reduce 84/126, find GCF(84, 126) = 42 in two steps (126 = 1 × 84 + 42, 84 = 2 × 42 + 0). Dividing top and bottom by 42 gives 2/3 in lowest terms. For adding or dividing fractions, the fraction calculator does the whole job.

Reading the result

The GCF can never be larger than the smallest number you enter. It equals that number when it divides all the others: GCF(12, 60) = 12. A GCF of 1 means the numbers are coprime (relatively prime), as with 17 and 25. They still have a least common multiple, but a fraction such as 17/25 is already in lowest terms.

Frequently asked questions

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. Which name you see depends on the textbook, the course and the country.

How do I find the GCF of three numbers?

Find the GCF of the first two, then the GCF of that result and the third number. For 24, 36 and 60: gcd(24, 36) = 12, then gcd(12, 60) = 12. The order doesn't change the answer.

What does coprime mean?

Two or more numbers are coprime when their GCF is 1, so they share no prime factor. 17 and 25 are coprime: the last nonzero remainder in the Euclidean steps is 1 (17 = 2 × 8 + 1, then 8 = 8 × 1 + 0). Neither number has to be prime; 25 = 5² is not.

What is the difference between the GCF and the LCM?

The GCF is the largest number that divides into all of your numbers; the least common multiple is the smallest number they all divide into. For 24, 36 and 60 the GCF is 12 and the LCM is 360. If you need a common denominator or a repeating schedule, use the LCM calculator instead.

Why are my numbers reordered in the steps?

The Euclidean algorithm always divides the larger number by the smaller one, so the table shows each pair with the larger number first. The result is the same either way.

Can I use zero, negatives or decimals?

No, enter positive whole numbers. By convention gcd(0, a) = a, because every number divides 0. For negative numbers, use their absolute values. Decimals and polynomials aren't supported.

Sources

  1. Wolfram MathWorld — Greatest Common Divisor
  2. Wolfram MathWorld — Euclidean Algorithm
  3. Euclid's Elements, Book VII, Proposition 2 (D. E. Joyce, Clark University)

This calculator is a learning aid. For graded work, show the method your teacher asks for.