document.documentElement.classList.add("cf-on");'; return; } ?>

GCF Calculator

GCF Calculator

This GCF calculator finds the greatest common factor of 2 to 20 whole numbers and shows every step.

Negative numbers use their absolute value. Zero is allowed alongside other numbers, because every number divides 0. Numbers up to 1,000,000,000,000 are supported.

Greatest common factor (GCF, HCF or GCD)
0
0least common multiple
Nocoprime (GCF of 1)?
0numbers divided by the GCF
0common factors in total
Working
All common factors

This free GCF calculator finds the greatest common factor of two to twenty whole numbers for pupils, parents, teachers and anyone simplifying a fraction or ratio. It works out the answer with the greatest common divisor method mathematicians use, then shows the working three ways: Euclid steps, prime factors or a list of factors. It also gives the lowest common multiple, every common factor and the numbers in their simplest ratio.

Quick answer: The greatest common factor is the largest whole number that divides every number in a set with no remainder. For 84, 126 and 210 the GCF is 42. A GCF calculator finds it fastest with Euclid's rule: divide, keep the remainder, and repeat until the remainder is 0. The last non zero remainder is the answer.

GCF calculator showing the greatest common factor of 84, 126 and 210 with Euclid steps, LCM and common factors
How the GCF Calculator works: whole numbers in, greatest common factor and full working out.

What Is a GCF Calculator?

A GCF calculator is a tool that returns the biggest whole number dividing all of your numbers exactly. The same value has three names: GCF (greatest common factor), HCF (highest common factor, the term used in UK schools and GCSE papers) and GCD (greatest common divisor, the term used in computing and university maths). So this tool is also a highest common factor calculator, and the answer is identical whichever name your textbook uses.

The formula in plain words is GCF(a, b) = GCF(b, remainder of a ÷ b), repeated until the remainder is 0. For more than two numbers, find the GCF of the first pair, then the GCF of that result and the next number, and so on. The order does not change the result.

How to Use the GCF Calculator

Step 1: Enter Your Numbers

Type two to twenty whole numbers, separated by commas or spaces. Negative numbers are treated as positive, and a 0 is allowed alongside other numbers. Decimals are rejected, because factors only apply to whole numbers.

Step 1: enter two or more whole numbers into the GCF calculator

Step 2: Choose How to Show the Working

Pick Euclid steps for large numbers, prime factors for homework that asks for a factor tree, or listing factors for small numbers and younger pupils. The answer stays the same; only the explanation changes.

Step 2: choose Euclid steps, prime factors or listing factors

Step 3: Read the GCF and LCM

The large figure is the greatest common factor. Below it you see the lowest common multiple, whether the numbers are coprime, and each number divided by the GCF, which is the set in its simplest ratio.

Step 3: read the greatest common factor, LCM and reduced numbers

Step 4: Check the Working

Copy the steps from the highest common factor calculator into your exercise book or compare them with your own method. The common factors list shows every number that divides the whole set, which is simply every factor of the GCF.

Step 4: check the working and the list of common factors

How Do You Find the Greatest Common Factor?

You find the greatest common factor by listing factors, by comparing prime factorisations, or by the Euclidean algorithm. Listing works well below about 100. For prime factors, write each number as a product of primes and multiply the primes they share, each at its lowest power: 84 = 2² × 3 × 7 and 126 = 2 × 3² × 7 share 2 × 3 × 7 = 42.

The third method needs no factorising at all, which is why calculators and computers prefer it. The Euclidean algorithm, described by Euclid around 300 BC, stays quick even for twelve digit numbers. For 126 and 84: 126 = 1 × 84 + 42, then 84 = 2 × 42 + 0. The last non zero remainder, 42, is the GCF. This greatest common factor calculator uses Euclid internally for speed.

GCF Calculator Examples

The table shows sets worked through with this GCF calculator, including a coprime pair and a set of three. Each simplest ratio is every number divided by the GCF.

NumbersGCFLCMSimplest ratio
14 and 357702 : 5
45 and 60151803 : 4
56 and 98143924 : 7
81 and 108273243 : 4
17 and 40168017 : 40
84, 126 and 210421,2602 : 3 : 5

What Is the Difference Between GCF and LCM?

The GCF is the largest number that divides into every number, while the LCM is the smallest number that every number divides into. For two numbers they are linked: GCF × LCM = a × b, so 14 × 35 = 490 = 7 × 70. When you need the multiple rather than the factor, for adding fractions or lining up repeating events, the LCM calculator with its own step by step working is the better fit, although this page shows the LCM too.

Worked example: Amira runs a craft stall and has three ribbons of 84 cm, 126 cm and 210 cm. She wants to cut them into equal pieces, as long as possible, with nothing wasted. The GCF of 84, 126 and 210 is 42, so each piece is 42 cm long. She gets 2 + 3 + 5 = 10 pieces. Any longer length, such as 63 cm, would not divide 84 cm exactly.

How Does the GCF Simplify Fractions and Ratios?

Dividing the top and bottom of a fraction by their GCF gives the simplest form in one step. For 48/180, a greatest common factor calculator returns 12, so 48/180 = 4/15. The same idea works for ratios: 84 : 126 : 210 becomes 2 : 3 : 5. To go further and turn the simplified fraction into a decimal, the fraction to decimal converter takes the result straight from here, and the ratio tool on this site scales ratios up as well as down.

What Happens With Zero, Negative or Prime Numbers?

Zero, negative and prime numbers follow three simple rules. First, GCF(n, 0) = n, because every whole number divides 0, but the GCF of 0 and 0 is undefined. Second, negative numbers use their absolute value, so GCF(−18, 24) = 6. Third, two different primes always have a GCF of 1, and a prime p shares either p or 1 with any other number.

Numbers with a GCF of 1 are called coprime, like 17 and 40 in the table, even though 40 is not prime. Consecutive whole numbers such as 20 and 21 are always coprime. This GCF calculator flags coprime sets and still shows the working so you can see why. Method and examples checked October 2026.

Key Greatest Common Factor Terms Explained

These terms explain the maths this GCF calculator uses, from prime factors to Euclid's remainders, so you can follow every line of the working it shows.

Greatest common factor
The largest whole number that divides every number in a set with no remainder. It is also called the highest common factor or the greatest common divisor, and for 84, 126 and 210 it is 42.
Euclidean algorithm
A method recorded by Euclid around 300 BC that replaces the larger number with the remainder of dividing it by the smaller one. When the remainder reaches 0, the last non zero remainder is the GCF.
Prime factorisation
Writing a whole number as a product of prime numbers, such as 84 = 2² × 3 × 7. Multiplying the primes shared by every number, each at its lowest power, gives the GCF.
Least common multiple
The smallest positive number that every number in the set divides into exactly. For two numbers it equals their product divided by their GCF, so the LCM of 14 and 35 is 70.
Coprime numbers
Two or more whole numbers whose only common factor is 1, so their GCF is 1. They need not be prime themselves: 17 and 40 are coprime even though 40 has many factors.
</>Embed this calculator on your website

Add the free GCF Calculator to your own site or blog. Copy the code below and paste it into an HTML block. It resizes itself and works on phones.

How we checked this tool: the Tools Veria Editorial Team built this tool by hand, checked it against the official rules or published standards where they apply, and tested it against worked examples. Results are estimates for planning, not personal financial or tax advice. Read our editorial policy and disclaimer, or report an error.

Frequently Asked Questions

What is the GCF of 84 and 126?

The GCF of 84 and 126 is 42. Euclid's method gives 126 = 1 × 84 + 42, then 84 = 2 × 42 + 0, so 42 is the last non zero remainder and the largest number dividing both.

Is GCF the same as HCF?

Yes. GCF (greatest common factor), HCF (highest common factor) and GCD (greatest common divisor) all mean the largest whole number that divides each number exactly. UK schools usually say HCF, while US textbooks say GCF.

Can the GCF be larger than the smallest number?

No. The GCF can never be larger than the smallest non zero number in the set, because it must divide that number. It equals the smallest number when that number divides all the others, as with 12 and 36.

What does a GCF of 1 mean?

A GCF of 1 means the numbers are coprime: they share no factor other than 1. For example, 17 and 40 are coprime, so the fraction 17/40 is already in its simplest form.

How do you find the GCF of three numbers?

Find the GCF of the first two numbers, then find the GCF of that answer and the third number. For 84, 126 and 210, GCF(84, 126) = 42, and GCF(42, 210) = 42.

How are GCF and LCM related?

For two positive whole numbers, the GCF multiplied by the LCM equals the product of the numbers. For 45 and 60, 15 × 180 = 2,700, which is 45 × 60. This shortcut does not apply directly to three or more numbers.