Mathematics

GCF Calculator

Last UpdatedAugust 2026

This GCF calculator finds the greatest common factor of two to ten numbers and shows the entire working, not just the answer. Pick listing factors, prime factorisation or Euclid's algorithm and you get the same result reached three different ways, so you can follow whichever one your class or textbook uses.

It also returns the LCM and, for two numbers, the simplified fraction. Everything runs in your browser and nothing is sent anywhere.

Try one

Greatest common factor

0

Least common multiple

0

Simplified fraction

0

01

What the greatest common factor calculator actually finds

The greatest common factor of a set of numbers is the largest whole number that divides every one of them exactly, leaving no remainder. The GCF of 12 and 18 is 6, because 6 divides both and nothing larger does.

GCF, GCD and HCF are three names for one thing

Which one you were taught depends mostly on where you went to school. They are identical, so a GCD calculator and an HCF calculator do exactly what this page does.

GCF

Greatest Common Factor. Common in the United States.

GCD

Greatest Common Divisor. Standard in mathematics and computer science.

HCF

Highest Common Factor. Common in the UK, India and much of the Commonwealth.

Two useful edge cases this calculator handles correctly. GCF(0, n) = n, because every number divides zero. And when the only shared factor is 1 the numbers are coprime, which is not a failure, it is the answer.

02

How to find the GCF: three methods worked through

Each of these gets the same answer. They differ in how much work they take, which is the whole reason three of them exist.

Method 1: listing factors

Write out every factor of each number and take the biggest one they share.

Factors of 18: 1, 2, 3, 6, 9, 18
Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24
Shared: 1, 2, 3, 6  →  GCF = 6

Best for small numbers, and the easiest to check by eye.

Method 2: the prime factorisation method

Break each number into primes, then multiply the primes they all share, each taken to its lowest power.

48 = 24 × 3
72 = 23 × 32
Shared, lowest powers: 23 × 3 = 8 × 3 = 24

Best for three or more numbers, and the method most exams want to see written out.

Method 3: Euclid's algorithm

Divide the larger by the smaller, keep the remainder, repeat with those two, and stop when the remainder hits zero. The last divisor is the GCF.

252 ÷ 105 = 2 remainder 42
105 ÷ 42 = 2 remainder 21
42 ÷ 21 = 2 remainder 0
→ GCF = 21

Far and away the fastest for large numbers. It never needs to know a single prime factor, which is why computers use it.

Euclid's algorithm is roughly 2,300 years old and is still what your phone uses when it reduces a fraction. It is set out in Book VII, Proposition 2 of Euclid's Elements, in David Joyce's edition at Clark University, where the problem is put as "to find the greatest common measure of two given numbers not relatively prime". Greatest common measure is the older name for the GCF, and "not relatively prime" is simply the historical way of saying the numbers are not coprime. The method has not changed since.

GCF calculator showing the greatest common factor of three numbers with step by step working
The calculator shows every step, so you can hand in the working rather than just the answer.
03

Finding the GCF of 3 numbers or more

The GCF of several numbers is built up in pairs. Work out the GCF of the first two, then take that answer against the third, and keep going:

GCF(a, b, c) = GCF( GCF(a, b), c )

So for 48, 72 and 120: GCF(48, 72) = 24, then GCF(24, 120) = 24. The order makes no difference, you can pair them up any way you like and land on the same number.

There is a shortcut worth knowing. If any number in the set is already a factor of all the others, it is the GCF and you can stop. And the GCF can never be larger than the smallest number in the set, which is a quick sanity check on any answer.

04

GCF and LCM: how the two are connected

For any two numbers, the greatest common factor and the least common multiple multiply out to the product of the numbers themselves:

GCF(a, b) × LCM(a, b) = a × b

Check it on 48 and 72: GCF is 24, LCM is 144, and 24 × 144 = 3,456, which is exactly 48 × 72. This is genuinely useful, because it means if you know one you can get the other without starting again.

Important limitation. This identity only holds for two numbers. It is not true for three or more: GCF(144, 180, 216) is 36 and the LCM is 2,160, but 36 × 2,160 is nowhere near 144 × 180 × 216. Plenty of sites state the rule without that caveat. This calculator only shows the verification line when you enter exactly two numbers, for that reason.

05

Using the GCF calculator to simplify fractions

Reducing a fraction to lowest terms is just dividing top and bottom by their GCF. Take 36/48:

GCF(36, 48) = 12
36 ÷ 12 = 3
48 ÷ 12 = 4
→ 36/48 = 3/4

Dividing by anything smaller than the GCF gets you part of the way but leaves the fraction reducible. Dividing by the GCF itself gets there in one move, which is the entire point of finding it. Tick the fraction box above and the calculator does this for any two numbers you enter.

06

Quick reference table

Every row below was recalculated before publishing. Type any of them into the calculator and the numbers will match.

NumbersGCFLCMQuickest method
12, 18636Listing factors
24, 361272Listing factors
48, 7224144Prime factorisation
100, 7525300Euclid's algorithm
56, 9814392Prime factorisation
17, 311527Coprime, no shared factor
144, 180, 216362,160Prime factorisation
1000, 7502503,000Euclid's algorithm

A note on that seventh row. It previously read LCM 1,080 on this page, which was wrong. 144 = 24 × 32, so the LCM must contain 24, and 1,080 does not. The correct answer is 2,160. It is fixed, and it is mentioned here rather than quietly corrected because a maths site that silently edits its answers is not worth much.

07

Where the GCF is actually used

Dividing things evenly

48 apples and 60 oranges into identical bags with nothing left over. GCF(48, 60) = 12, so twelve bags, each with 4 apples and 5 oranges.

Cutting materials

Rope of 90 cm and 126 cm cut into equal pieces with no waste. GCF is 18, so 18 cm is the longest piece that works.

Screen aspect ratios

1920 × 1080 has a GCF of 120. Divide both and you get 16:9, which is where the familiar widescreen ratio comes from.

Gears and timing

Two gears with 24 and 36 teeth realign every LCM(24, 36) = 72 teeth. GCF and LCM together describe the whole cycle.

08

GCF calculator FAQ

There is none. Greatest Common Factor, Greatest Common Divisor and Highest Common Factor all describe the same number. GCF is the usual term in American schools, HCF in the UK, India and much of the Commonwealth, and GCD in mathematics and computer science. A GCD calculator and an HCF calculator will give you the same answer as this one.
It is 1. Every pair of whole numbers shares 1 as a factor, so the GCF is never zero for positive numbers. When 1 is the only shared factor the numbers are called coprime, or relatively prime. GCF(17, 31) = 1 because both are prime and different. Two numbers can be coprime without either being prime: 8 and 9 share nothing but 1.
Do it in pairs. Find the GCF of the first two, then find the GCF of that answer and the third number. For 48, 72 and 120: GCF(48, 72) = 24, then GCF(24, 120) = 24. The order you pair them in makes no difference to the result. This calculator accepts up to ten numbers and chains them the same way.
For small numbers, list the factors, it is quick and easy to check. For three or more numbers, or when you need to show working in an exam, use prime factorisation. For large numbers use Euclid's algorithm, which finds the GCF of two six-digit numbers in a handful of steps without factorising anything.
GCF(0, n) = n. Every whole number divides zero exactly, so the largest factor they share is n itself. This calculator handles zero correctly rather than rejecting it. GCF(0, 0) is undefined, since every number divides zero and there is no largest one.
Only for two numbers. GCF(a, b) times LCM(a, b) does equal a times b, always. For three or more it breaks down: GCF(144, 180, 216) = 36 and LCM = 2,160, and those multiplied together are nothing like 144 times 180 times 216. Many sites state the rule without that limit, which is why the verification line here only appears when you enter exactly two numbers.
No, and that is a handy check. A factor of a number can never exceed it, so the GCF is at most the smallest number in your set. If it equals the smallest number, that number divides all the others exactly.
This calculator takes whole numbers of zero or above. The greatest common factor is defined for integers, so decimals do not apply directly. For negatives, the GCF is conventionally taken as positive, so GCF(-12, 18) is 6, the same as GCF(12, 18). Enter the values without the minus sign.
Up to about 9 quadrillion, which is the largest whole number JavaScript can hold exactly. Above that, arithmetic loses precision, and rather than showing a confident wrong answer the calculator tells you the value has gone beyond exact integer range.
09

About this calculator

How the answers are produced

The GCF is computed with Euclid's algorithm and the LCM from the identity LCM(a, b) = a divided by GCF(a, b), multiplied by b, which avoids overflow that a direct multiplication would cause. The step-by-step working is generated independently in whichever method you select, so the displayed steps are a genuine derivation and not a story told backwards from an answer already known. Every worked example and every table row on this page was recalculated before publishing.

No sources to cite, and that is the point

Unlike a cost or finance tool, nothing here rests on someone else's data. Every claim on this page can be verified with a pencil. If you think an answer is wrong, work it through by hand and tell us, because you will be able to prove it either way.

Privacy

Everything runs in your browser. The numbers you type are never sent to a server and nothing is stored.

Aayush Kulshrestha, founder of Calcxi

Written & verified by

Aayush Kulshrestha

B.Tech Computer Science · 8 years in web development & SEO · Bhilwara, India
About · LinkedIn · Report an error