GCF Calculator
Find the greatest common factor of two or more numbers.
Try an example
12
About this calculator
What Is the Greatest Common Factor (GCF)?
The greatest common factor — also called the greatest common divisor (GCD) or highest common factor — of two or more whole numbers is the largest number that divides all of them without a remainder. For example, GCF(32, 256) = 32. Type your numbers, separated by commas, into this GCF calculator to get the answer for two numbers or a longer list.
Method 1: Prime Factorization
Break each number into its prime factors, pick out the primes they have in common, and multiply those together. 16 = 2 × 2 × 2 × 2 and 24 = 2 × 2 × 2 × 3, so they share 2 × 2 × 2 = 8, and GCF(16, 24) = 8. This is easy for small numbers but slow when the numbers are large and hard to factor.
Worked Example
The GCF of 24 and 36 is 12 — the largest number that divides evenly into both.
Method 2: The Euclidean Algorithm
A far more efficient approach goes back to ancient Greece. Divide the larger number by the smaller and keep only the remainder; then repeat with the smaller number and that remainder, until the remainder is zero. The last non-zero remainder is the GCF. For 48 and 18: 48 ÷ 18 leaves 12; 18 ÷ 12 leaves 6; 12 ÷ 6 leaves 0, so GCF = 6. Even numbers with six digits take only a handful of steps. For three or more numbers, find the GCF of the first two, then the GCF of that result and the next number.
Where You Will Use It
- Simplifying fractions: divide the numerator and denominator by their GCF to reduce to lowest terms (see the Fraction Calculator).
- Simplifying ratios: 20 : 30 reduces to 2 : 3 by dividing both by 10.
- Splitting things evenly: the GCF tells you the largest group size that divides several quantities with nothing left over — for example, how many identical gift bags you can make from 24 pencils and 36 erasers (12).
- Number theory and cryptography, where gcd calculations underpin many algorithms.
GCF and LCM
For two numbers, GCF × LCM = a × b. If you know one, you can find the other. See the LCM Calculator for the other half.
Worked example
The greatest common factor of 24 and 36 is 12 — the largest number that divides both evenly (24 ÷ 12 = 2, 36 ÷ 12 = 3).
Frequently asked questions
How is the GCF calculated?
This calculator uses the Euclidean algorithm, repeatedly dividing and taking remainders until it reaches the largest number that divides every input with no remainder.
What's the GCF used for?
Simplifying fractions to lowest terms, splitting quantities into equal groups, and factoring expressions in algebra all rely on finding the GCF.
What if the numbers share no common factor besides 1?
Then the GCF is 1, and the numbers are called "coprime" — for example, 8 and 15 have a GCF of 1.
Can I find the GCF of more than two numbers?
Yes — add as many numbers as you need; the calculator finds the GCF pairwise across the whole list.

