GCF Calculator

A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call

Free GCF calculator. Find the greatest common factor (greatest common divisor) of two or more numbers, with Euclid's steps and the LCM too.

Least common multiple
0
Coprime?
0
Numbers
0

Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.

How to use the GCF calculator

  1. Enter two or more whole numbers, separated by commas or spaces, for example 48, 180 or 12 18 30.
  2. Read the result. The GCF calculator shows the greatest common factor, the least common multiple (LCM), and whether the numbers are coprime (share no factor except 1).
  3. See the steps. For two numbers, it shows Euclid's algorithm step by step, so you can follow or check the working.

It handles very large whole numbers exactly, and negative numbers too (the GCF is always given as a positive number).

What is the greatest common factor?

The greatest common factor (GCF) of two or more whole numbers is the largest number that divides all of them with no remainder. It's also called the greatest common divisor (GCD) or the highest common factor (HCF): three names for the same thing.

For 48 and 180:

  • Factors of 48: 1, 2, 3, 4, 6, 8, 12, 16, 24, 48
  • Factors of 180: 1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 30, 36, 45, 60, 90, 180
  • Common factors: 1, 2, 3, 4, 6, 12
  • Greatest common factor: 12

Three ways to find the GCF

1. List the factors

Write out all the factors of each number and pick the largest one they share. This is easy for small numbers but slow for large ones.

2. Prime factorization

Break each number into prime factors, then multiply the primes they have in common, using the lowest power of each:

  • 48 = 2⁴ × 3
  • 180 = 2² × 3² × 5
  • Common: 2² × 3 = 12

Our prime factorization calculator breaks numbers into primes.

3. Euclid's algorithm

This is the fastest method, and it's what the GCF calculator uses. Divide the larger number by the smaller and keep the remainder; then divide the smaller number by the remainder; repeat until the remainder is zero. The last non-zero remainder is the GCF.

For 180 and 48:

  • 180 = 3 × 48 + 36
  • 48 = 1 × 36 + 12
  • 36 = 3 × 12 + 0

The last non-zero remainder is 12. Euclid described this method more than 2,000 years ago, and it's still used in computers today, including in cryptography.

GCF of more than two numbers

Find the GCF of the first two numbers, then the GCF of that result and the next number, and so on. GCF(12, 18, 30) = GCF(GCF(12, 18), 30) = GCF(6, 30) = 6. The GCF calculator does this automatically for any number of values.

GCF and LCM

The least common multiple (LCM) is the smallest number that all the numbers divide into. For two numbers, the GCF and LCM are connected:

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

For 48 and 180: 12 × LCM = 8,640, so LCM = 720. The GCF calculator shows both. For more on the LCM, see the LCM calculator.

Where the GCF is used

Simplifying fractions

Divide the numerator and denominator by their GCF to reduce a fraction to lowest terms. 48/180: the GCF is 12, so 48/180 = 4/15. The simplify fractions calculator does this in one step.

Simplifying ratios

A ratio of 48:180 simplifies to 4:15 in the same way. See the ratio calculator.

Splitting things into equal groups

You have 48 cupcakes and 180 cookies and want identical gift boxes with no leftovers. The GCF, 12, is the largest number of boxes you can make: each gets 4 cupcakes and 15 cookies.

Tiling and cutting

To cut a 48 × 180 cm sheet into the largest identical squares with no waste, use 12 cm squares (the GCF).

Factoring in algebra

To factor 12x + 18, take out the GCF of 12 and 18, which is 6: 6(2x + 3).

Coprime numbers

Two numbers are coprime (or relatively prime) if their GCF is 1, such as 8 and 15. They don't need to be prime themselves. Coprime numbers matter in fractions (a fraction is in lowest terms when its numerator and denominator are coprime) and in cryptography.

Special cases

  • GCF with zero: GCF(a, 0) = a, because every number divides zero. GCF(0, 0) isn't defined.
  • Negative numbers: the GCF is given as a positive number, so GCF(−12, 18) = 6.
  • One number divides the other: the GCF is the smaller number. GCF(15, 45) = 15.
  • Consecutive numbers are always coprime: GCF(20, 21) = 1.

A worked example

Priya is organising a school fair. She has 84 juice boxes, 126 snack bars and 210 stickers, and she wants to make identical goody bags with nothing left over.

In the GCF calculator, she enters 84, 126, 210. The GCF is 42, so she can make 42 bags, each with 2 juice boxes, 3 snack bars and 5 stickers. The LCM, 1,260, isn't needed here, but she notes that the numbers aren't coprime.

Who uses a GCF calculator

Students and teachers use it for fractions, ratios and factoring homework. Parents use it to check answers. Programmers use the GCD in algorithms, and anyone splitting items into equal groups or cutting materials into equal pieces can use it.

Need more customers from Google?

This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. DeepRit manages Google Ads for small and mid-size businesses, and only Google Ads. We check your account before we ever get on a call, then fix the structure, the keywords, the tracking and the ads, with month-to-month terms and no long contract. Book a free audit call.

GCF table for common pairs

Numbers GCF LCM
8 and 12 4 24
12 and 18 6 36
15 and 25 5 75
16 and 24 8 48
18 and 27 9 54
20 and 30 10 60
24 and 36 12 72
36 and 48 12 144
42 and 56 14 168
60 and 90 30 180

The binary GCD method

Computers sometimes use another method, Stein's algorithm (the binary GCD), which uses only subtraction, halving and checks for even numbers. Those operations are very fast for computers working in binary. It produces the same answer as Euclid's algorithm. The GCF calculator uses Euclid's algorithm with exact whole-number arithmetic, which is fast enough for numbers with hundreds of digits.

GCF word problems

Many school problems use the GCF in disguise. Clues that you need the GCF:

  • "Largest," "greatest" or "maximum" number of groups, pieces or rows.
  • "Equal" groups with "nothing left over."
  • Splitting two or more different quantities into identical sets.

Clues that you need the LCM instead:

  • "Smallest," "least" or "next time" something happens together.
  • Events that repeat at different intervals, such as buses leaving every 12 and 18 minutes (they leave together again after the LCM, 36 minutes).

Teaching the GCF

For students, the factor-list method builds understanding, prime factorization connects to other topics, and Euclid's algorithm shows an elegant shortcut. A good sequence is to start with listing factors for small numbers, move to prime factor trees, and introduce Euclid's algorithm for larger numbers. The GCF calculator's step-by-step output helps students check each line of their own working.

Common mistakes

  • Confusing GCF with LCM: the GCF is never larger than the smallest number; the LCM is never smaller than the largest.
  • Stopping at a common factor that isn't the greatest, such as 6 instead of 12 for 48 and 180.
  • Forgetting to use the lowest power of shared primes in prime factorization.
  • Including non-shared primes in the product.

GCF with fractions and decimals

The GCF is defined for whole numbers. To find a "common factor" of decimals, scale them to whole numbers first: for 1.2 and 1.8, multiply by 10 to get 12 and 18, whose GCF is 6, then divide back by 10 to get 0.6. For fractions, the GCF of the numerators divided by the LCM of the denominators gives the largest fraction that divides both evenly. These extensions are used occasionally in measurement problems, for example cutting lengths of 1.2 m and 1.8 m into equal pieces with nothing left over: the longest possible piece is 0.6 m. The GCF calculator works with whole numbers, so scale decimals before entering them.

Sources and further reading

Frequently asked questions

How do you find the GCF?

List common factors, use prime factorization, or use Euclid's algorithm. The GCF calculator uses Euclid's algorithm and shows the steps.

What is the GCF of 12 and 18?

Is GCF the same as GCD and HCF?

Yes. Greatest common factor, greatest common divisor and highest common factor all mean the same thing.

What is the GCF of two prime numbers?

1, unless the primes are the same number.

How are the GCF and LCM related?

For two numbers, GCF × LCM = the product of the numbers.

Is the GCF calculator free?

Yes. It's free, needs no sign-up, and works in your browser.

Free PPC audit

See where your ad budget leaks.

We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.

Book a free audit call 30-minute call · Free · The audit is yours to keep