Free Online Tool

Greatest Common Factor (GCF) Calculator

Enter two to five whole numbers and instantly see their greatest common factor, each number's prime factorization, and the full Euclidean algorithm working, with no submit button and no waiting.

2–5numbers supported
3methods explained
100%free & instant
GCF Calculator Live

Enter whole numbers only. Decimals are truncated and zero is ignored.

Enter at least two whole numbers to see the GCF.
Show factorization & Euclidean steps ▼
01: DEFINITION

What Is the Greatest Common Factor?

The greatest common factor is the biggest building block a group of numbers shares. It is the foundation every fraction, ratio, and factoring problem eventually rests on.

The Core Idea

The greatest common factor (GCF) of a set of numbers is the largest positive integer that divides every number in the set without leaving a remainder. For example, the GCF of 8 and 12 is 4, because 4 is the biggest number that divides both 8 and 12 evenly. No larger number works for both.

Also Called the GCD

You will often see the same value called the greatest common divisor (GCD). GCF and GCD describe exactly the same calculation; GCF is the phrase most US textbooks use, while GCD shows up more in advanced math and computer science, including this calculator's underlying algorithm.

Why It Matters

Finding the GCF is the key step in simplifying fractions to lowest terms, reducing ratios, and factoring algebraic expressions. As shown below, it also computes the least common denominator of two or more fractions without brute-force guessing.

02: METHODS

How to Find the GCF

There are three standard ways to find a greatest common factor. Small numbers are easiest to handle by listing factors; larger or multiple numbers are usually faster with prime factorization or the Euclidean algorithm.

Method Best for How it works
Listing Factors Best for small numbers you can factor by hand List every factor of each number, then pick the largest value the lists share.
Prime Factorization Best for numbers with several factors or larger values Break each number into primes, then multiply the shared primes at their lowest shared power.
Euclidean Algorithm Best for large numbers or fast, error-free calculation Divide the larger number by the smaller, keep the remainder, and repeat until the remainder is zero.

Listing Factors

List every factor of each number, then find the largest value the lists have in common. This method is quick and visual for numbers small enough to factor in your head.

Example: GCF of 12 and 18

Prime Factorization

Break every number into its prime factors, then multiply only the primes that appear in all the numbers, each raised to the lowest power it reaches across the whole set. This scales far better than listing factors once numbers get large.

Example: GCF of 24 and 36

Euclidean Algorithm

The Euclidean algorithm finds the GCF without factoring at all: divide the larger number by the smaller, note the remainder, then repeat the division using the smaller number and the remainder in place of the original pair. When the remainder finally hits zero, the last non-zero remainder is the GCF. It is the method computers use because it is fast even for very large numbers.

Example: GCF of 48 and 18

  1. 48 = 2 × 18 + 12
  2. 18 = 1 × 12 + 6
  3. 12 = 2 × 6 + 0
  4. The remainder is now 0, so the last non-zero remainder, 6, is the GCF.
03: RELATIONSHIP

GCF and LCD

The greatest common factor and the least common denominator are two sides of the same coin: one divides numbers down to their shared core, the other multiplies them up to a shared total.

LCD(a, b) = (a × b) ÷ GCF(a, b)

Because every LCM (and therefore every least common denominator) can be built directly from a GCF, you never have to search for a common denominator blindly. For denominators 24 and 30: GCF(24, 30) = 6, so the LCD is (24 × 30) ÷ 6 = 720 ÷ 6 = 120. That single division replaces a whole list of trial multiples.

120
LCM: multiply up (× 5, × 4)
24
30
6
GCF: divide down (÷ 4, ÷ 5)

Reading the ladder from the middle down, 24 and 30 both reduce to the shared factor 6, which is the GCF. Reading from the middle up, 24 and 30 both scale up to the shared multiple 120, which is the LCM and the value you would use as an LCD when adding fractions with denominators 24 and 30.

04: EXAMPLES

Worked GCF Examples

Six fully solved examples covering listing factors, prime factorization, and a three-number GCF. These show the same working style the calculator above produces automatically.

Example 1 Listing factors

GCF of 8 and 12

8 ,12
  • Factors of 8: 1, 2, 4, 8
  • Factors of 12: 1, 2, 3, 4, 6, 12
  • Shared factors: 1, 2, 4
GCF 4
Example 2 Listing factors

GCF of 6 and 9

6 ,9
  • Factors of 6: 1, 2, 3, 6
  • Factors of 9: 1, 3, 9
  • Shared factors: 1, 3
GCF 3
Example 3 Listing factors

GCF of 12 and 18

12 ,18
  • Factors of 12: 1, 2, 3, 4, 6, 12
  • Factors of 18: 1, 2, 3, 6, 9, 18
  • Shared factors: 1, 2, 3, 6
GCF 6
Example 4 Prime factorization

GCF of 24 and 36

24 ,36
  • 24 = 2³ × 3
  • 36 = 2² × 3²
  • Shared primes at lowest power: 2² × 3¹
GCF 12
Example 5 Prime factorization

GCF of 15 and 25

15 ,25
  • 15 = 3 × 5
  • 25 = 5²
  • Shared prime at lowest power: 5¹
GCF 5
Example 6 Three numbers

GCF of 12, 18 and 24

12 ,18 ,24
  • GCF(12, 18) = 6
  • GCF(6, 24) = 6
  • So GCF(12, 18, 24) = 6
GCF 6
05: REFERENCE

GCF Reference Table

A quick lookup of common number pairs and their greatest common factor. Handy for checking homework or spotting the pattern behind the Euclidean algorithm above.

Number A Number B GCF
8 12 4
6 9 3
12 18 6
24 36 12
15 25 5
10 15 5
9 15 3
14 21 7
16 24 8
18 27 9
Number A Number B GCF
20 30 10
21 28 7
22 33 11
25 35 5
27 36 9
28 42 14
30 45 15
32 48 16
35 49 7
36 54 18
06: FAQ

Common GCF Questions

What is the GCF of 8 and 12?
The greatest common factor of 8 and 12 is 4. The factors of 8 are 1, 2, 4, 8; the factors of 12 are 1, 2, 3, 4, 6, 12. The largest number appearing in both lists is 4. Since 4 is also the GCF, dividing both numbers by it gives the fully reduced ratio 2:3.
What is the difference between GCF and LCM?
The GCF (greatest common factor) is the largest number that divides two or more numbers evenly, while the LCM (least common multiple) is the smallest number that all of them divide into evenly. GCF shrinks down toward a shared factor; LCM grows up toward a shared multiple. For 12 and 18, the GCF is 6 and the LCM is 36.
How do you find the GCF using prime factorization?
Break each number down into its prime factors, then multiply together only the primes that appear in every number, using the lowest power each prime reaches across all of them. For 24 (2³ × 3) and 36 (2² × 3²), the shared primes are 2² and 3¹, so the GCF is 4 × 3 = 12.
What is the GCF of 3 numbers?
To find the GCF of three or more numbers, find the GCF of any two of them first, then find the GCF of that result and the next number. For 12, 18, and 24: GCF(12, 18) = 6, and GCF(6, 24) = 6, so the GCF of all three numbers is 6.
Is GCF the same as GCD?
Yes. GCF (greatest common factor) and GCD (greatest common divisor) are two names for the exact same value: the largest positive integer that divides every number in a set without leaving a remainder. GCF is the term used more often in US school math; GCD is more common in number theory and computer science.
What is the GCF of 12 and 18?
The greatest common factor of 12 and 18 is 6. Listing factors: 12 → 1, 2, 3, 4, 6, 12; 18 → 1, 2, 3, 6, 9, 18. The largest shared value is 6, which also matches 2 × 3 from prime factorization.