Math calculator

Free greatest common factor (GCF) calculator

Find the greatest common factor of two or more numbers using the Euclidean algorithm — enter your numbers to see the GCF instantly, updated live, as you type.

InputsLive
Integers
Enter 2 or more positive integers separated by commas or spaces.
Result
GCF
6
GCF of 12, 18, 24 = 6
GCF (GCD)6
LCM72
Count3
Values12, 18, 24

GCF/GCD via Euclidean algorithm. Extended to N numbers by reduction.

Results are estimates. Consult a professional.

How it's calculated

How the greatest common factor calculator works

The greatest common factor (GCF) of two or more integers is the largest integer that divides all of them without a remainder. It is also called the greatest common divisor (GCD) or highest common factor (HCF). The most efficient method for large numbers is the Euclidean algorithm.

Euclidean algorithm:
GCF(a, b) = GCF(b, a mod b) until b = 0
When b = 0, the answer is a
Prime factorization method:
GCF = product of shared prime factors at their lowest powers

The Euclidean algorithm is fast even for very large numbers because each step reduces the problem size. It converges in at most O(log(min(a,b))) steps.

Weisstein, Eric W. — Greatest Common Divisor. MathWorld, Wolfram Research.
Example

Worked example: GCF(48, 18) via Euclidean algorithm

Example: GCF(48, 18)

Find the greatest common factor of 48 and 18 step by step using the Euclidean algorithm.

Step 1: GCF(48, 18) → 48 mod 18 = 12 → GCF(18, 12)
Step 2: GCF(18, 12) → 18 mod 12 = 6 → GCF(12, 6)
Step 3: GCF(12, 6) → 12 mod 6 = 0 → GCF(6, 0)
b = 0, so GCF = 6
GCF(48, 18) = 6
The largest integer that divides both 48 and 18 evenly is 6. Useful for simplifying 18/48 to 3/8.
Quick reference

GCF for common number pairs

The table below shows GCF results for frequently encountered number pairs — handy for simplifying fractions and ratios.

abGCF(a, b)Simplifies fraction to
12843/2
181263/2
2436122/3
481868/3
10075254/3
5642144/3
9060303/2
14496483/2

GCF computed via Euclidean algorithm. "Simplifies fraction to" shows a/b ÷ GCF in lowest terms.

Practical tips

Tips for finding the greatest common factor

The GCF is most useful for simplifying fractions and factoring expressions. These tips speed up the process.

  • Use the Euclidean algorithm for large numbers — listing all factors of 1,547 by hand is tedious; repeated division by the remainder is always faster.
  • GCF of more than two numbers — compute pairwise: GCF(a, b, c) = GCF(GCF(a, b), c); the calculator handles this automatically.
  • Simplify fractions in one step — divide both numerator and denominator by their GCF to reach the lowest-terms fraction immediately.
  • GCF and LCM are linked — GCF(a, b) × LCM(a, b) = a × b; if you know one, you can find the other without extra work.
  • GCF = 1 means the numbers are coprime — coprime integers share no common factors; this matters in modular arithmetic, cryptography, and fraction simplification.
Accuracy & limits

Accuracy and limitations

The GCF calculator uses the Euclidean algorithm and returns exact integer results for any pair of positive integers within JavaScript's safe integer range (up to 2⁵³ − 1, or about 9 quadrillion). Input must be positive integers; the GCF is not defined for non-integers or zero (though GCF(a, 0) = a by convention, which is the algorithm's natural termination condition).

Glossary

Key terms

The largest positive integer that divides two or more integers without a remainder. Also called GCD or HCF.
An integer that divides another integer exactly (with zero remainder).
An iterative method for finding the GCF by repeatedly replacing (a, b) with (b, a mod b) until the remainder is 0.
The remainder after integer division; e.g., 48 mod 18 = 12 because 48 = 2 × 18 + 12.
Two integers whose GCF is 1 — they share no common factors greater than 1.
Expressing a number as a product of prime numbers; GCF equals the product of shared primes at their lowest exponents.
About

About this calculator

Part of our math calculators suite — explore all calculators.

Questions

Frequently asked questions about the free greatest common factor (GCF) calculator

A greatest common factor calculator is a free online tool that helps you find the largest integer that divides every number in a list. Useful for simplifying fractions, schedules, and ratios. The greatest common factor (GCF, also called GCD) is the largest positive integer that divides every input without remainder. It's computed efficiently by the Euclidean algorithm — repeatedly replacing the larger number with its remainder. It runs entirely in your browser with instant results and no sign-up.
Yes. 'Greatest common factor' (GCF) and 'greatest common divisor' (GCD) are interchangeable — they describe the same number, just from two angles ('factor' emphasises the divisor, 'divisor' the act of dividing).
Then the GCF is 1. 'Coprime' literally means 'share no common factor other than 1'. 7 and 13 are coprime; their GCF is 1.
GCF is defined only for non-negative integers. The calculator takes the absolute value of any negative inputs and ignores non-integer values. If you need GCF for fractions, simplify each first.

Want a calculator built for your business?

Customize any of our 400+ tools to match your brand, or commission a new one tailored to how your business actually calculates — pricing, payroll, quotes, anything. Deployed on your domain, math runs in your visitors' browsers.