CalculatorSwitch
Calculator Switch
Math

GCF Calculator (Greatest Common Factor)

Last updated:

How to Use This Calculator

Step 1: Enter two or more positive whole numbers separated by commas or spaces.

Step 2: Click Calculate to see the GCF.

Step 3: Review the step-by-step Euclidean algorithm and the prime factorization of each number.

What Is the Greatest Common Factor?

The greatest common factor (GCF), also called greatest common divisor (GCD) or highest common factor (HCF), is the largest positive integer that divides every number in a set without leaving a remainder.

For example, the GCF of 12 and 18 is 6 — both numbers divide evenly by 6, and no larger integer works.

The GCF is used to reduce fractions to lowest terms, simplify ratios, and solve divisibility problems in number theory.

How the GCF Is Calculated

Euclidean algorithm: GCF(a, b) = GCF(b, a mod b), repeating until the remainder is 0.

Example: GCF(48, 18)
48 ÷ 18 = 2 remainder 12
18 ÷ 12 = 1 remainder 6
12 ÷ 6 = 2 remainder 0 → GCF = 6

For three or more numbers: GCF(a, b, c) = GCF(GCF(a, b), c)

Common GCF Pairs

NumbersGCFUse Case
12, 186Simplify 12/18 → 2/3
24, 3612Reduce fraction 24/36 → 2/3
50, 10050Scale 50:100 → 1:2
15, 255Reduce 15/25 → 3/5
48, 60, 8412Multi-number GCF

Examples

Example 1: GCF(48, 60) = 12 — useful for reducing 48/60 to 4/5.

Example 2: GCF(17, 23) = 1 — both are prime, so they share no common factor besides 1.

Example 3: GCF(100, 250, 400) = 50 — the largest number that divides all three.

Tips

GCF of 1 means coprime. Numbers share no factors except 1.

Prime factorization method — multiply the lowest power of each shared prime.

Always simplifies fractions. Divide numerator and denominator by their GCF.

For negatives, take absolute values — GCF is always positive.

Frequently Asked Questions

What is the difference between GCF and LCM?
GCF (greatest common factor) is the largest number that divides all the given numbers evenly. LCM (least common multiple) is the smallest number that all the given numbers divide into evenly. For 4 and 6, the GCF is 2 (largest common divisor) and the LCM is 12 (smallest common multiple). The two are related by the identity: GCF times LCM equals the product of the two numbers.
How do I find the GCF by hand using prime factorization?
Break each number into its prime factors. For 48, that is 2 times 2 times 2 times 2 times 3. For 60, that is 2 times 2 times 3 times 5. Then identify the primes that appear in both lists and multiply the lowest power of each. Both 48 and 60 share two 2s and one 3, so the GCF is 2 times 2 times 3, which equals 12.
Can the GCF of two numbers be larger than either number?
No. The GCF can never exceed the smaller of the two numbers, because a factor of a number cannot be larger than the number itself. The maximum possible GCF of two numbers is the smaller number itself, which happens when the smaller number divides the larger one evenly. For example, GCF(12, 24) equals 12.
What is the GCF of two prime numbers?
The GCF of any two different prime numbers is always 1, because primes have no divisors other than 1 and themselves. For example, GCF(7, 13) equals 1. When the GCF of two numbers is 1, mathematicians call them 'coprime' or 'relatively prime' — they share no common factors besides 1, even though neither needs to be prime itself.
How is the Euclidean algorithm faster than prime factorization?
Prime factorization requires you to fully factor both numbers, which becomes slow for very large numbers. The Euclidean algorithm works by repeatedly replacing the larger number with the remainder of dividing it by the smaller — this converges to the GCF in very few steps, typically log-scale in the size of the numbers. It works without ever needing to know the prime factors, which is why computer algebra systems use it.
Can I find the GCF of decimal numbers?
The GCF is mathematically defined only for integers. If you have decimals, first multiply all values by a power of 10 to make them whole numbers, find the GCF of those integers, and then divide back. For example, the 'GCF' of 1.5 and 2.25 can be found by scaling to 150 and 225 — GCF is 75 — then divided back to 0.75. This calculator expects integer inputs.

Related Calculators

Was this useful?