Mathematics

Greatest Common Factor: Formula, Rules & Examples

The greatest common factor of two or more integers is the largest positive integer that divides every number exactly. It is commonly abbreviated as GCF and is also called the greatest common divisor, or GCD.

For example, consider:

24 and 36

Their positive common factors are:

1, 2, 3, 4, 6, 12

The largest is:

12

Therefore:

GCF(24, 36) = 12

The greatest common factor is useful for simplifying fractions, creating the largest possible equal groups, reducing ratios, factoring expressions, and analyzing integer divisibility throughout arithmetic and number theory.

What Is the Greatest Common Factor?

A positive integer d is a common factor of integers a and b when:

a ÷ d = integer

and:

b ÷ d = integer

The greatest common factor is the largest positive value satisfying both conditions.

In modular notation:

a mod d = 0

b mod d = 0

For example, with:

a = 18

b = 30

the common factors are:

1, 2, 3, 6

The largest is:

6

So:

GCF(18,30) = 6

The shorter GCF page explains the abbreviation and core concept, while this page focuses on the calculation methods, rules, and applications of the greatest common factor.

Greatest Common Factor Formula

Conceptually:

GCF(a,b) = greatest positive integer d such that d | a and d | b

The notation:

d | a

means:

d divides a exactly

For more than two integers:

GCF(a,b,c,…)

is the largest positive integer that divides every value in the set.

There is no single arithmetic expression that is always the easiest way to calculate the GCF. Factor lists, prime factorization, and the Euclidean algorithm are the most common methods.

Method 1: Find the GCF by Listing Factors

For small integers, list all positive factors of each number and identify the largest value that appears in every list.

Find:

GCF(20, 32)

Factors of 20:

1, 2, 4, 5, 10, 20

Factors of 32:

1, 2, 4, 8, 16, 32

The shared factors are:

1, 2, 4

The greatest is:

4

Therefore:

GCF(20,32) = 4

Example: GCF of 36 and 48

Factors of 36:

1, 2, 3, 4, 6, 9, 12, 18, 36

Factors of 48:

1, 2, 3, 4, 6, 8, 12, 16, 24, 48

Their common factors are:

1, 2, 3, 4, 6, 12

The largest is:

12

Therefore:

GCF(36,48) = 12

This method is easy to understand, but complete factor lists become inconvenient for large integers.

Method 2: Find the GCF With Prime Factorization

A systematic alternative uses prime factorization.

Find:

GCF(72,120)

Prime-factorize both values:

72 = 2³ × 3²

120 = 2³ × 3 × 5

Identify the prime bases that appear in both factorizations.

Both contain:

2 and 3

For each common prime, use the smaller exponent.

For 2:

min(3,3) = 3

For 3:

min(2,1) = 1

Therefore:

GCF = 2³ × 3¹

= 8 × 3

= 24

So:

GCF(72,120) = 24

Prime-Exponent Formula for the GCF

Suppose:

a = p₁^α₁ × p₂^α₂ × … × pₖ^αₖ

and:

b = p₁^β₁ × p₂^β₂ × … × pₖ^βₖ

after including exponent zero for primes absent from one number.

Then:

GCF(a,b) = p₁^min(α₁,β₁) × p₂^min(α₂,β₂) × … × pₖ^min(αₖ,βₖ)

In words:

Use only common prime factors and choose the smaller exponent for each.

This rule follows from the fact that a common divisor cannot contain more copies of a prime than either original number contains.

Example Using Prime Exponents

Find:

GCF(360,504)

Factor:

360 = 2³ × 3² × 5

504 = 2³ × 3² × 7

The common prime powers are:

and:

Therefore:

GCF = 2³ × 3²

= 8 × 9

= 72

So:

GCF(360,504) = 72

Check:

360 ÷ 72 = 5

504 ÷ 72 = 7

Both quotients are integers.

Method 3: Find the GCF With the Euclidean Algorithm

For large integers, the Euclidean algorithm is often more efficient than finding complete prime factorizations.

The central rule is:

GCF(a,b) = GCF(b,r)

where r is the remainder when a is divided by b.

Find:

GCF(252,105)

Begin:

252 = 105 × 2 + 42

Then:

105 = 42 × 2 + 21

Then:

42 = 21 × 2 + 0

The final nonzero remainder is:

21

Therefore:

GCF(252,105) = 21

Why the Euclidean Algorithm Finds the GCF

Suppose:

a = bq + r

Any number dividing both a and b must also divide:

a – bq

But:

a – bq = r

So common divisors of a and b are also common divisors of b and r.

Conversely, a divisor of both b and r also divides:

bq + r = a

Therefore:

GCF(a,b) = GCF(b,r)

The repeated divisions make the numbers smaller without changing their GCF.

Example: GCF of 1,071 and 462

Use repeated division:

1071 = 462 × 2 + 147

462 = 147 × 3 + 21

147 = 21 × 7 + 0

The last nonzero remainder is:

21

Therefore:

GCF(1071,462) = 21

No prime factorization of either starting number was necessary.

GCF of Three Numbers

The greatest common factor can be found for more than two integers.

Consider:

24, 36, 60

First:

GCF(24,36) = 12

Then:

GCF(12,60) = 12

Therefore:

GCF(24,36,60) = 12

You can also compare their common factors directly.

All three are divisible by:

1, 2, 3, 4, 6, 12

and no larger positive integer divides all three.

GCF of Four Numbers

Find:

GCF(48,72,120,168)

Start with:

GCF(48,72) = 24

Then:

GCF(24,120) = 24

Then:

GCF(24,168) = 24

Therefore:

GCF(48,72,120,168) = 24

The process can be extended to any finite collection of integers.

GCF When One Number Divides Another

If one positive integer divides another exactly, the smaller integer is the GCF.

For example:

GCF(15,60)

Since:

60 = 15 × 4

15 divides both 15 and 60.

No common factor can be larger than the smaller number.

Therefore:

GCF(15,60) = 15

In general, if:

a | b

then:

GCF(a,b) = |a|

when a is the smaller nonzero magnitude.

GCF of Equal Numbers

For any nonzero integer a:

GCF(a,a) = |a|

For example:

GCF(42,42) = 42

Every divisor of 42 is shared, and the largest positive one is 42 itself.

GCF of Consecutive Integers

Consecutive integers always have GCF 1.

For example:

GCF(49,50) = 1

Suppose a positive integer d divided both 49 and 50.

Then it would also divide their difference:

50 – 49 = 1

The only positive divisor of 1 is 1.

Therefore consecutive integers are always coprime.

Coprime Numbers

Two integers are coprime when:

GCF(a,b) = 1

For example:

8 and 15

Factors of 8:

1, 2, 4, 8

Factors of 15:

1, 3, 5, 15

The only shared factor is:

1

Therefore:

GCF(8,15) = 1

Neither number must be prime individually.

GCF of Two Different Prime Numbers

If p and q are distinct prime numbers:

GCF(p,q) = 1

For example:

GCF(13,19) = 1

because:

Factors of 13 = 1,13

Factors of 19 = 1,19

Only 1 is shared.

GCF With Zero

For any nonzero integer a:

GCF(a,0) = |a|

For example:

GCF(48,0) = 48

Every positive divisor of 48 also divides zero because:

0 = d × 0

The largest positive divisor shared by 48 and zero is therefore 48.

GCF With Negative Numbers

The greatest common factor is conventionally reported as positive.

For example:

GCF(-24,36) = 12

and:

GCF(-24,-36) = 12

A practical method is:

GCF(a,b) = GCF(|a|,|b|)

The signs do not alter which positive integers divide the magnitudes exactly.

Greatest Common Factor and Fraction Simplification

One of the most important uses of the GCF is fraction simplification.

Consider:

84 / 126

Find:

GCF(84,126) = 42

Divide numerator and denominator by 42:

84 ÷ 42 = 2

126 ÷ 42 = 3

Therefore:

84/126 = 2/3

Using the greatest common factor reduces the fraction to lowest terms in one step.

Another Fraction Example

Simplify:

150 / 210

Find:

GCF(150,210) = 30

Then:

150/210 = (150 ÷ 30)/(210 ÷ 30)

= 5/7

Therefore:

150/210 = 5/7

Since:

GCF(5,7) = 1

the fraction is fully reduced.

Greatest Common Factor and Fraction Operations

A result from fraction operations may need reduction.

For example:

5/12 + 7/12 = 12/12

The numerator and denominator have GCF:

12

Divide:

12/12 = 1/1 = 1

For a less immediate example:

7/15 × 10/21 = 70/315

The GCF of 70 and 315 is:

35

So:

70/315 = 2/9

GCF identifies the largest reduction available after the arithmetic.

Greatest Common Factor and LCM

For positive integers:

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

Therefore:

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

Suppose:

a = 18

b = 30

First:

GCF(18,30) = 6

Then:

LCM(18,30) = (18 × 30)/6

= 540/6

= 90

Therefore:

LCM(18,30) = 90

The dedicated LCM page owns the least-common-multiple calculation itself.

GCF vs. LCM

The two concepts answer different questions.

For 12 and 18:

GCF(12,18) = 6

because 6 is the largest number dividing both.

But:

LCM(12,18) = 36

because 36 is the smallest positive number divisible by both.

A useful distinction is:

GCF looks downward toward shared divisors.

LCM looks upward toward shared multiples.

Greatest Common Factor in Equal Grouping

Suppose a teacher has:

48 pencils

and:

72 notebooks

and wants to create the greatest possible number of identical supply sets without leftovers.

The number of sets must divide both 48 and 72.

Find:

GCF(48,72) = 24

Therefore:

24 identical sets

can be made.

Each set contains:

48 ÷ 24 = 2 pencils

and:

72 ÷ 24 = 3 notebooks

Greatest Common Factor in Cutting Problems

Suppose two lengths are:

96 cm

and:

144 cm

They must be cut into equal pieces of the greatest possible integer length with no waste.

Find:

GCF(96,144)

Prime factorizations:

96 = 2⁵ × 3

144 = 2⁴ × 3²

Use smaller exponents:

GCF = 2⁴ × 3

= 16 × 3

= 48

Therefore:

Maximum piece length = 48 cm

Greatest Common Factor in Rectangular Arrays

Suppose:

54 red tiles

and:

90 blue tiles

must be arranged into the greatest possible number of identical groups.

Find:

GCF(54,90)

Prime-factorize:

54 = 2 × 3³

90 = 2 × 3² × 5

Use:

2 × 3²

= 18

Therefore:

18 groups

Each group has:

54 ÷ 18 = 3 red tiles

and:

90 ÷ 18 = 5 blue tiles

Using GCF to Factor Algebraic Terms

The greatest common factor idea extends naturally to algebraic expressions.

Consider:

12x³ + 18x²

The numerical GCF of 12 and 18 is:

6

Both terms also contain:

Therefore the common factor is:

6x²

Factor it out:

12x³ + 18x² = 6x²(2x + 3)

The arithmetic GCF provides the numerical part of the factorization.

Example With Several Terms

Factor:

20a³ + 30a² – 50a

The numerical GCF is:

GCF(20,30,50) = 10

Every term contains at least one factor of a.

So the common algebraic factor is:

10a

Factor:

20a³ + 30a² – 50a = 10a(2a² + 3a – 5)

The greatest common factor should be removed completely before looking for additional structure inside the remaining expression.

GCF and Prime Factor Exponents

Suppose:

A = 2⁵ × 3² × 7

B = 2³ × 3⁴ × 5 × 7²

The GCF uses only common primes:

2, 3, 7

with smaller exponents:

Therefore:

GCF(A,B) = 2³ × 3² × 7

= 8 × 9 × 7

= 504

This exponent rule makes large factored numbers relatively easy to compare.

Greatest Common Factor and Divisibility Rules

Divisibility rules can identify potential common factors quickly.

Suppose the numbers are:

234 and 378

Both are even, so 2 is a common factor.

Digit sums:

2 + 3 + 4 = 9

3 + 7 + 8 = 18

Both are divisible by 9, so 9 is also a common factor.

But a divisibility test does not automatically prove that 9 is the greatest common factor. A complete GCF method is still needed.

Indeed:

GCF(234,378) = 18

So testing only one obvious common divisor can stop too early.

Greatest Common Factor and Fractions to Percent

Suppose a score is represented by:

42/56

Before converting fractions to percent, simplify using:

GCF(42,56) = 14

Then:

42/56 = 3/4

and:

3/4 = 75%

Therefore:

42/56 = 75%

The GCF simplifies the fraction; the percentage conversion is a separate representation step.

Greatest Common Factor and Geometric Sequences

A geometric sequence is defined by a constant ratio, not by a common factor.

For example:

12, 36, 108

is geometric with:

r = 3

These integer terms also share:

GCF(12,36,108) = 12

But a shared GCF does not prove a sequence is geometric.

For example:

12, 24, 60

also has GCF 12, yet its consecutive ratios are not equal.

The concepts answer different questions.

Greatest Common Factor and Harmonic Sequences

A harmonic sequence is defined through reciprocals whose values form an arithmetic sequence.

Its terms are often fractional, so ordinary integer GCF calculations are not what determines whether the sequence is harmonic.

A GCF may appear when simplifying the numerators and denominators involved, but the defining test is based on the reciprocal sequence.

Greatest Common Factor and Hexadecimal Numbers

The value of an integer does not depend on whether it is written in decimal or hexadecimal.

For example:

24 decimal = 18 hexadecimal

and:

36 decimal = 24 hexadecimal

Their greatest common factor remains the same underlying integer:

GCF(24,36) = 12 decimal

Changing the numeral system changes the representation, not the divisor relationships among the integers.

Choosing the Best GCF Method

Factor lists are usually convenient when the numbers are small.

Prime factorization is useful when the prime structures are easy to obtain or already known.

The Euclidean algorithm is usually preferable for large numbers because it avoids full factorization.

For example:

GCF(899,493)

would require substantial factor-list work.

The Euclidean algorithm gives:

899 = 493 × 1 + 406

493 = 406 × 1 + 87

406 = 87 × 4 + 58

87 = 58 × 1 + 29

58 = 29 × 2 + 0

Therefore:

GCF(899,493) = 29

Common Greatest Common Factor Mistakes

One common mistake is finding a common factor but not the greatest one.

For:

24 and 36

6 divides both, but:

12

also divides both.

Therefore the GCF is 12, not 6.

Another mistake is choosing common prime exponents incorrectly. For a GCF, use the smaller exponent, not the larger one.

For:

2⁴ × 3²

and:

2² × 3⁵

the common prime powers are:

2² × 3²

not:

2⁴ × 3⁵

Another error is confusing the GCF with the LCM.

Finally, when simplifying a fraction, divide numerator and denominator by the same GCF.

How to Check a GCF Answer

Suppose:

GCF(84,126) = 42

First verify exact division:

84 ÷ 42 = 2

126 ÷ 42 = 3

Then note:

GCF(2,3) = 1

If a larger common factor than 42 existed, the reduced quotients 2 and 3 would still share a factor greater than 1.

They do not.

Therefore:

42 is indeed the greatest common factor

Frequently Asked Questions

What is the greatest common factor?

The greatest common factor is the largest positive integer that divides every integer in a given set without a remainder.

Is greatest common factor the same as GCF?

Yes. GCF is the standard abbreviation for greatest common factor.

Is GCF the same as GCD?

In elementary number theory, GCF and greatest common divisor generally refer to the same positive value.

What is the GCF of 12 and 18?

Common factors:

1, 2, 3, 6

Therefore:

GCF(12,18) = 6

What is the GCF of 24 and 36?

GCF(24,36) = 12

What is the GCF of 36 and 48?

GCF(36,48) = 12

What is the GCF of 72 and 120?

72 = 2³ × 3²

120 = 2³ × 3 × 5

Therefore:

GCF = 2³ × 3 = 24

How do you find a GCF using prime factorization?

Prime-factorize each integer, retain only the primes common to every factorization, and use the smallest exponent of each common prime.

How do you find a GCF using the Euclidean algorithm?

Repeatedly divide and replace the pair with the divisor and remainder. The last nonzero remainder is the GCF.

Can the greatest common factor be 1?

Yes. Numbers with GCF 1 are coprime.

Can the GCF equal the smaller number?

Yes. This happens when the smaller positive number divides the larger exactly.

How is the GCF used with fractions?

Divide the numerator and denominator by their GCF to reduce the fraction to lowest terms.

Final Example

Find:

GCF(420,756)

Use the Euclidean algorithm.

First:

756 = 420 × 1 + 336

Then:

420 = 336 × 1 + 84

Then:

336 = 84 × 4 + 0

The last nonzero remainder is:

84

Therefore:

GCF(420,756) = 84

Check:

420 ÷ 84 = 5

756 ÷ 84 = 9

Since:

GCF(5,9) = 1

the original common factor cannot be increased.

The greatest common factor is therefore the largest exact divisor shared by all the integers being compared, and factor lists, prime factorization, and the Euclidean algorithm provide three reliable ways to find it.

Mehran Khan

Mehran Khan is the primary author at The Logic Library and CEO & Founder of One Digit Media. With 10+ years of experience in software engineering, SEO, and digital publishing, he uses a research-led approach to Logics, Maths, Tech, Formulas, Science, and AI.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button