Skip to GCF calculator

GCF Calculator

Find the greatest common factor of two or more numbers instantly, with clear steps using prime factorization, common factors, and the Euclidean algorithm.

GCF calculator inputs

Results update as you type. Integers stay in this browser.

Example: 24, 36, 60. Whole numbers only — including negatives and 0.

Greatest common factor

GCF = 6

The greatest common factor of 12, 18 is 6 because 6 is the largest positive whole number that divides each of them evenly.

Common factors: 1, 2, 3, 6

Reduced ratio: 2 : 3

  1. GCF(12, 18) = 6

    • 18 = 12 × 1 + 6
    • 12 = 6 × 2 + 0

Default GCF(12, 18) = 6. Browser-only BigInt math. Integers are not uploaded to EverydayTools.

Advertisement

What Is the Greatest Common Factor?

The greatest common factor (GCF) is the largest positive whole number that divides two or more integers without leaving a remainder. For example, the GCF of 12 and 18 is 6 because both numbers are divisible by 6, and no larger positive integer divides them both.

The same value is also called the greatest common divisor (GCD) or highest common factor (HCF). US classrooms usually say GCF; programming libraries usually say GCD. This page computes that shared positive divisor. It does not factor polynomials or algebraic expressions.

How to Use the GCF Calculator

  1. Enter two or more integers, separated by commas, spaces, or new lines.
  2. Read the GCF as you type, or press Calculate. Invalid tokens are rejected instead of being rounded.
  3. Open Factors, Prime factorization, or Euclidean algorithm to inspect the working that matches those methods.

How to Find the Greatest Common Factor

Method 1: Listing Common Factors

List every positive factor of each number, then take the largest value that appears on every list. For 12 and 18, the factors of 12 are 1, 2, 3, 4, 6, 12 and the factors of 18 are 1, 2, 3, 6, 9, 18. The common list is 1, 2, 3, 6, so the GCF is 6. Listing is clear for small homework numbers and slow once the integers grow.

Method 2: Prime Factorization

Write each number as a product of primes, keep only the primes that appear in every factorization, and use the lowest exponent of each. For 360 and 504 the calculator reports 2^3 × 3^2 × 5 and 2^3 × 3^2 × 7. Shared primes at lowest powers give 2^3 × 3^2 = 72. This is the method that also explains GCF versus LCM: GCF uses minimum exponents, LCM uses maximum.

Method 3: Euclidean Algorithm

Replace the pair (a, b) with (b, a mod b) until the remainder is 0. The last non-zero remainder is the GCF. For 1071 and 462:

  1. 1,071 = 462 × 2 + 147
  2. 462 = 147 × 3 + 21
  3. 147 = 21 × 7 + 0

The remainder hits 0 after 21, so GCF(1071, 462) = 21. This is the method the calculator uses for the exact answer, including integers too large to factor quickly.

GCF Formula and Mathematical Method

  • gcd(a, b) = gcd(b, a mod b), with gcd(a, 0) = |a| when a ≠ 0.
  • GCF(a, b, c) = gcd(gcd(a, b), c). Extra numbers fold in the same way.
  • GCF(a, b) = gcd(|a|, |b|). The displayed GCF is a positive integer.
  • If a = ∏ pα and b = ∏ pβ, then gcd(a, b) = ∏ pmin(α,β).
  • For nonzero a and b, gcd(a, b) × lcm(a, b) = |a × b|.

gcd(0, 0) is not treated as an ordinary greatest positive factor here. An all-zero list is rejected with that explanation. Decimal input is rejected; this page does not round 12.5 to 12.

GCF Examples With Answers

Verified GCF values from this calculator
NumbersGCFWhy
12, 186Largest shared factor of 12 and 18
24, 3612Also 24/36 reduces to 2/3
18, 246Order does not change the GCF
8, 151Coprime — GCF 1 is a valid answer
24, 36, 6012Pairwise: GCF(24,36)=12, then GCF(12,60)=12
48, 180, 24012Three-number chain
1071, 46221Euclidean remainders end at 21
0, 1818GCF(0, n) = |n| when n ≠ 0
-12, 186Signs are ignored; GCF is positive

100 and 250 have GCF 50 because 100 = 2 × 50 and 250 = 5 × 50. 250 ÷ 100 = 2.5, so 100 is not a factor of 250.

GCF of Two, Three, or More Numbers

For two numbers, one Euclidean chain is enough: GCF(24, 36) = 12. For three numbers, fold the result into the next value:

GCF(24, 36) = 12

GCF(12, 60) = 12

Therefore GCF(24, 36, 60) = 12

The same chain extends to the 12-integer limit on this page. Coprime sets such as 8 and 15 still have a GCF: 1.

Where Is GCF Used?

  • Simplifying fractions. Divide numerator and denominator by GCF(a, b). 24/36 becomes 2/3. After that reduction, no integer greater than 1 divides both parts. Use the Fraction Calculator when you also need to add or subtract.
  • Reducing ratios. The same 24 : 36 pair reduces to 2 : 3. Continue in the Ratio Calculator.
  • Identical groups. 24 pencils and 36 erasers can fill 12 identical bags with 2 pencils and 3 erasers each. 12 is the number of bags, not the number of items in a bag.
  • Equal segments. Boards of 84 in and 126 in cut into 42 in pieces with nothing left over.
  • Square tiles on an integer grid. A 48 by 72 rectangle tiles with 24 × 24 squares.

GCF vs. LCM

GCF(12, 18) = 6. The least common multiple of the same pair is 36. Factors divide a number; multiples are produced by multiplying it. Use GCF to simplify. Use the LCM Calculator when you need a common denominator or a first shared multiple. For nonzero a and b, GCF × LCM = |a × b|.

Common Mistakes When Finding GCF

  • Listing multiples instead of factors, then confusing the answer with an LCM.
  • Stopping at a common factor such as 2 when the greatest shared factor is larger.
  • Treating GCF = 1 as a failure. Relatively prime integers are allowed.
  • Using maximum prime exponents (the LCM rule) instead of minimum exponents.
  • Displaying GCF(0, 0) = 0 as if it were an ordinary greatest positive factor. This page refuses that list.
  • Keeping a negative GCF. The value is gcd(|a|, |b|); -12, 18 still gives 6.
  • Rounding a decimal so the tool can continue. 12.5 is rejected.
  • Using GCF when adding unlike fractions. That task needs an LCM for the denominators.

Frequently Asked Questions

What does GCF stand for?

Greatest common factor. It is the largest positive integer that divides every number in the list with no remainder. GCF(12, 18) = 6.

How do you find the greatest common factor?

List common factors and take the largest, multiply shared primes at their lowest powers, or use the Euclidean algorithm: replace (a, b) with (b, a mod b) until the remainder is 0. This calculator uses Euclidean arithmetic for the exact GCF.

What is the GCF of 12 and 18?

6. Common factors are 1, 2, 3, and 6. 12/18 therefore simplifies to 2/3.

What is the GCF of 24 and 36?

12. 24 = 2^3 × 3 and 36 = 2^2 × 3^2, so the shared primes at lowest powers are 2^2 × 3 = 12. Twelve identical groups can hold 2 and 3 items from those counts.

Can you calculate the GCF of three numbers?

Yes. GCF(a, b, c) = gcd(gcd(a, b), c). GCF(24, 36) = 12 and GCF(12, 60) = 12, so GCF(24, 36, 60) = 12. The input accepts up to 12 integers.

Is GCF the same as GCD or HCF?

Yes. Greatest common factor, greatest common divisor, and highest common factor name the same positive integer. US homework usually says GCF; code libraries usually say GCD.

Can GCF equal 1?

Yes. If the numbers share no prime factor, they are coprime and the GCF is 1. GCF(8, 15) = 1, and 8/15 is already in lowest terms.

How do you find GCF using prime factorization?

Factor each integer, keep only primes that appear in every factorization, and use the smallest exponent of each. Multiply those prime powers. 360 = 2^3 × 3^2 × 5 and 504 = 2^3 × 3^2 × 7, so the GCF is 2^3 × 3^2 = 72.

What is the Euclidean algorithm?

It finds gcd(a, b) by repeating gcd(b, a mod b) until the remainder is 0. The last non-zero remainder is the GCF. For 1071 and 462 the remainders are 147, then 21, then 0, so the GCF is 21.

How is GCF used to simplify fractions?

Divide the numerator and the denominator by GCF(a, b). 24/36 ÷ 12 becomes 2/3. After a complete reduction, no integer greater than 1 divides both parts. That is not the same as adding fractions, which needs an LCM for the denominators.

What happens if one number is zero?

GCF(0, 18) = 18 and GCF(0, -18) = 18. Zero is a multiple of every integer, so the non-zero magnitude wins. GCF(0, 12, 18) = 6. An all-zero list has no greatest positive common divisor on this page.

Does the calculator support decimal numbers or large integers?

Decimals, fractions, and scientific notation are rejected. Negatives are allowed; the GCF is still positive. Exact GCF uses BigInt Euclidean arithmetic up to 40 digits per integer. Full factor lists and prime breakdowns are limited so the page stays responsive.

GCF(0, 18) = 18. Calculations run in the browser and are not uploaded.

Advertisement