Free tool
GCF Calculator (Greatest Common Factor)
Find the greatest common factor of two or more whole numbers, with the division steps, prime factorization and big-number support. Free and private.
- Greatest common factor (GCF)
- –
- Least common multiple (for comparison)
- –
- Shared prime factors, lowest powers
- –
- Prime factorization of each number
- –
Division steps
Assumptions and limits
Every figure comes from the numbers you enter. Where a rule of thumb is used, it is labeled as one.
- The GCF is found with repeated division and remainders, using exact BigInt arithmetic with no rounding.
- More than two numbers are combined one at a time: GCF(a, b, c) = GCF(GCF(a, b), c).
- Only whole numbers of 1 or greater are accepted, with up to 20 numbers of up to 100 digits each.
- Prime factorization is shown for numbers up to 1,000,000,000,000. Larger numbers get the division steps only.
- The least common multiple tile is computed from the same numbers using LCM(a, b) = a × b ÷ GCF(a, b).
Runs entirely in your browser. Nothing you type or upload is sent to our servers.
How the greatest common factor is found
The greatest common factor of a set of whole numbers is the largest whole number that divides each of them evenly. This calculator uses two routes and shows both. The first is repeated division with remainders, which stays fast even for numbers with dozens of digits. The second is prime factorization, which makes the answer easy to see for smaller numbers: keep each prime that every number contains, at the lowest power it appears with, and multiply.
Each line of the division route is a plain equation of the form dividend = quotient × divisor + remainder, so you can check any step by hand with one multiplication and one addition.
Worked example 1: 12 and 18
- Divide the larger by the smaller: 18 = 1 × 12 + 6.
- Divide the old divisor by that remainder: 12 = 2 × 6 + 0.
- The remainder is now 0, and the last nonzero remainder is 6, so the GCF is 6.
Check: 12 ÷ 6 = 2 and 18 ÷ 6 = 3. The quotients 2 and 3 share no factor other than 1, so no larger number could work.
Worked example 2: 24, 36 and 60
- Factor each number: 24 = 2³ × 3, 36 = 2² × 3², and 60 = 2² × 3 × 5.
- Primes in all three: 2 and 3. Lowest powers: 2² (from 36 and 60) and 3¹ (from 24 and 60).
- Multiply: 2² × 3 = 4 × 3 = 12.
The division route agrees: GCF(24, 36) = 12, then GCF(12, 60) = 12. The calculator opens with these three numbers.
Where the GCF helps
- Reducing fractions. Divide the top and bottom by the GCF to reach lowest terms in one move.
- Splitting evenly. With 24 pencils and 36 erasers, the most identical kits you can build with nothing left over is GCF(24, 36) = 12 kits.
- Checking a ratio. Dividing every part of a ratio by the GCF gives the simplest form of the same ratio.
Related calculators
The matching LCM Calculator finds the smallest number that all of yours divide into. Reduce a fraction directly with the Fraction Calculator, or simplify a ratio with the Ratio Calculator. To turn a fraction into a decimal, use the Fraction to Decimal Calculator.
Frequently asked questions
What does the GCF calculator find?
It finds the greatest common factor: the largest whole number that divides every number you enter with no remainder. For 12 and 18 the answer is 6, because 6 divides both (12 ÷ 6 = 2 and 18 ÷ 6 = 3) and no larger whole number does. Enter two or more numbers, separated by commas or spaces.
How do the division steps work?
Divide the larger number by the smaller one and keep the remainder. Then divide the smaller number by that remainder, and repeat until a remainder of 0 appears. The last nonzero remainder is the GCF. For 18 and 12: 18 = 1 × 12 + 6, then 12 = 2 × 6 + 0, so the GCF is 6. The calculator prints each line.
What is the GCF when numbers share nothing but 1?
The GCF is 1. For 8 and 9, the only whole number that divides both is 1, so GCF(8, 9) = 1. The calculator reports this as a normal result. A fraction whose numerator and denominator have a GCF of 1, such as 8/9, is already in lowest terms.
How do I use the GCF to simplify a fraction?
Divide the numerator and the denominator by their GCF. For 18/24, the GCF of 18 and 24 is 6, so 18 ÷ 6 = 3 and 24 ÷ 6 = 4, giving 3/4. Because you divide by the largest common factor, the result is fully reduced in one step rather than several smaller ones.
Can I enter more than two numbers?
Yes, up to 20. The calculator finds the GCF of the first two numbers, then the GCF of that answer and the third number, and so on. The order does not change the result. For 24, 36 and 60 this gives GCF(24, 36) = 12, then GCF(12, 60) = 12, so the answer is 12.
How large can the numbers be?
Each number can have up to 100 digits. The arithmetic uses exact whole-number math rather than floating point, so a result such as the GCF of two 30-digit numbers is correct digit for digit. Prime factorization is shown only for numbers up to 1,000,000,000,000; larger numbers still get the full division steps.
Why are zero and negative numbers not accepted?
This page works with positive whole numbers. Every whole number divides 0, so a GCF that includes 0 is a special case, and negative numbers and decimals have no ordinary factor list. Enter whole numbers of 1 or greater. To work with a decimal, scale it to a whole number first, for example 1.5 and 2.5 become 15 and 25.
Is anything I type saved or sent anywhere?
No. The calculation runs in your browser, and nothing you enter is stored or sent to our servers. Only a count that the tool was used is recorded, without any numbers from the form.
Link to this tool
Found it useful? Copy a link for your page, newsletter or documentation.
Get new tools and guides by email
Optional. The tool above works without signing up.
More free tools
Browse all everyday calculators or the full list of free tools.
- LCM Calculator (Least Common Multiple)Find the least common multiple of two or more whole numbers, with prime factorization and the working shown. Very large integers are handled exactly.
- Standard Deviation CalculatorCalculate population or sample standard deviation, variance and mean from your own data, with every step of the working shown and exact arithmetic.
- Average Calculator: Mean, Median, Mode & RangeFind the average of a list of numbers: mean, median, mode, range, sum and count, with the working shown. Exact results with no floating-point error.
- Decimal to Fraction CalculatorConvert any decimal to a simplified fraction or mixed number, including repeating decimals such as 0.(3). Exact results, with the working shown.
- Gravel CalculatorEstimate gravel in cubic yards, cubic meters and tons for a driveway, path or base layer, with the density you enter and an optional extra allowance.
- Mulch CalculatorFind how many cubic yards and bags of mulch a garden bed needs from its size and depth, plus how much area a cubic yard covers at that depth.