GCF Calculator

Type two or more numbers to find the largest number that divides into all of them. You may know it as the GCD or the HCF.

GCF12
Common factors1, 2, 3, 4, 6, 12
Simplified48/180 = 4/15
LCM720
Try

How it was worked out

Break each number into primes, then keep only what all of them share

What the greatest common factor means

The factors of 12 are 1, 2, 3, 4, 6 and 12. The factors of 18 are 1, 2, 3, 6, 9 and 18. They share 1, 2, 3 and 6, and the biggest of those is 6, so that's the GCF.

It answers a practical question: what's the largest equal group I can make? Say you have 48 pencils and 180 stickers to share out into party bags with nothing left over. The GCF is 12, so you can fill 12 bags, each with 4 pencils and 15 stickers.

GCF, GCD and HCF are the same thing

Greatest common factor, greatest common divisor and highest common factor all mean the same number. The name you see tends to depend on where you are. HCF is common in UK and Indian schools, GCF in the US, and GCD in programming.

Three ways to find it by hand

List the factors

Write out the factors of each number and pick the largest match. It's a clear way to see the idea, and it gets slow once the numbers grow.

12: 1, 2, 3, 4, 6, 12. 18: 1, 2, 3, 6, 9, 18. Largest match: 6

Use prime factors

Break each number into primes. Keep only the primes in every number, using the lowest power you can see of each, then multiply.

48 = 2⁴ × 3. 180 = 2² × 3² × 5. Shared: 2² × 3 = 12

Use Euclid's method

Divide the larger number by the smaller and keep the remainder. Then divide the smaller number by that remainder, and carry on until nothing is left. The last number you divided by is the GCF.

180 ÷ 48 leaves 36. 48 ÷ 36 leaves 12. 36 ÷ 12 leaves 0. GCF: 12

This one appears in Euclid's Elements from around 300 BC, and computers still use it. You never need to factor anything, so it stays quick even with huge numbers. It works because anything that divides both of your numbers must also divide the remainder.

For three or more numbers, take them a pair at a time. Find the GCF of the first two, then the GCF of that answer and the third number.

Shortcuts worth knowing

One number divides the other

The GCF is the smaller number. The GCF of 12 and 60 is 12, because 12 already goes into 60.

The numbers are next to each other

Consecutive numbers never share a factor, so the GCF of 35 and 36 is 1.

Check the difference

The GCF always divides the gap between two numbers. 180 − 48 is 132, so the GCF of 48 and 180 has to be a factor of 132. That cuts down what you need to test.

An answer of 1 is a real answer

Numbers with a GCF of 1 are called coprime. They don't need to be prime themselves, as 15 and 28 show.

Where you'll actually use it

18/24 = 3/4

Simplifying fractions

Divide the top and bottom by their GCF, which is 6 here, and the fraction reaches its lowest terms in a single step.

1920 × 1080

Screen shapes

The GCF of these is 120. Divide both by it and you get 16 and 9, which is where the term 16:9 comes from.

48 × 180 cm

Tiling a floor

The largest square tile that fits without cutting has sides of 12 cm. You'd need 4 rows of 15, which makes 60 tiles.

24 m and 36 m

Cutting material

To cut two ribbons into the longest equal pieces with no waste, use the GCF. Pieces of 12 m give you 5 in total.

How the GCF and LCM fit together

The LCM uses the highest power of every prime, and the GCF uses the lowest power of the shared ones. Between them they account for every prime in both numbers exactly once, so for two numbers the GCF times the LCM always equals the numbers multiplied together.

48 × 180 = 8,640, and 12 × 720 = 8,640

This only holds for two numbers. With 2, 4 and 6, the GCF is 2 and the LCM is 12, which gives 24, while the three numbers multiply to 48.

GCF chart for 1 to 12

Find one number along the top and the other down the side. Select any answer to see its working.

Where answers usually go wrong

Stopping at the first common factor

2 is a common factor of 48 and 180, but it isn't the greatest. If you can still divide both results by something, you haven't finished.

Finding the LCM by mistake

The GCF can't be bigger than your smallest number. If your answer is larger than one of the numbers, you've found a multiple.

Keeping a prime that only one number has

180 has a 5 and 48 doesn't, so 5 stays out of the GCF. A prime has to appear in every number to count.

Using the highest power

48 has 2⁴ and 180 has 2². Only 2² fits into both, so that's the one to keep.

Try these yourself

Work each one out on paper before you open it.

What is the GCF of 24 and 36?

12. 24 is 2³ × 3 and 36 is 2² × 3², so the shared part is 2² × 3.

What is the GCF of 84 and 126?

42. Using Euclid's method, 126 ÷ 84 leaves 42, then 84 ÷ 42 leaves 0.

What is the GCF of 18, 30 and 42?

6. The GCF of 18 and 30 is 6, and 6 also divides 42.

Common questions

What is the GCF of a number and 0?

It's the number itself, because every number divides into 0. The GCF of 7 and 0 is 7. This calculator asks for numbers from 1 upwards, since that's what most people mean to enter.

What is the GCF of two prime numbers?

It's 1 if they're different, because a prime's only factors are 1 and itself. If they're the same prime, it's that prime.

What about negative numbers?

Ignore the signs and use the positive values. The GCF is normally given as a positive number, so −12 and 18 have a GCF of 6.

Why does the "Simplified" row only appear for two numbers?

A fraction has a top and a bottom, so it needs exactly two. It treats your first number as the top and the second as the bottom.

How large can the numbers be?

You can enter up to 20 numbers, each up to 1,000,000,000,000. Write them without commas inside, like 1000000. Listing factors only appears when the lists are short enough to compare.

Are my numbers sent anywhere?

No. The calculation runs in your browser, so your numbers never reach our server. A link you copy from the address bar can contain them.