Skip to content

GCF Calculator — Free Online Greatest Common Factor Calculator

Find the greatest common factor of two or more numbers instantly with step-by-step Euclidean algorithm solutions and factor analysis.

Enter 2 or more positive integers

Parsed Numbers

48, 36, 60

Greatest Common Factor

12

Euclidean Algorithm Steps

GCF(48, 36) = 12

GCF(12, 60) = 12

GCF Details

GCF(48, 36, 60) = 12

Factors of GCF: 1, 2, 3, 4, 6, 12

How to Use the GCF Calculator

  1. Enter your numbers: Type two or more positive integers into the input field, separated by commas. For example, enter "48, 36, 60" to find the GCF of three numbers. The calculator accepts any number of integers, making it ideal for both simple two-number problems and complex multi-number calculations.
  2. Review the parsed numbers: Below the input, the calculator displays the numbers it has recognized and will use in the calculation. This lets you verify your input is correct before examining the results.
  3. Read the GCF result: The right panel prominently displays the Greatest Common Factor. This is the largest number that evenly divides all of your input numbers with zero remainder.
  4. Examine the step-by-step solution: The Euclidean Algorithm Steps section shows exactly how the GCF was calculated, applying the algorithm pair by pair through your numbers. This is valuable for learning the method and verifying homework solutions.
  5. Check additional details: The GCF Details section shows whether the GCF itself is prime or composite, and lists the factors of the GCF. This additional context is useful for advanced number theory problems.

Results update in real time as you type, so you can experiment with different number sets and immediately see how the GCF changes. The calculator handles up to thousands of numbers simultaneously.

GCF Formula and the Euclidean Algorithm

Euclidean Algorithm

GCF(a, b) = GCF(b, a mod b), until b = 0

GCF-LCM Relationship

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

Prime Factorization Method

GCF = product of lowest powers of common prime factors

Variables Explained

  • a, b: The two positive integers whose GCF you want to find. When finding the GCF of more than two numbers, the algorithm is applied iteratively: first compute GCF(a, b), then compute GCF(result, c), and so on.
  • mod (modulo): The remainder operator. "a mod b" gives the remainder when a is divided by b. For example, 48 mod 18 = 12, because 48 = 2 x 18 + 12.
  • GCF result: The final non-zero value when the algorithm terminates. When the remainder reaches 0, the previous divisor is the GCF.

Step-by-Step Example

Find GCF(252, 198):

  1. 252 = 1 x 198 + 54 (remainder is 54)
  2. 198 = 3 x 54 + 36 (remainder is 36)
  3. 54 = 1 x 36 + 18 (remainder is 18)
  4. 36 = 2 x 18 + 0 (remainder is 0, so we stop)

The last non-zero remainder is 18, so GCF(252, 198) = 18. You can verify: 252 / 18 = 14 and 198 / 18 = 11, both whole numbers. The Euclidean algorithm is highly efficient, running in O(log(min(a, b))) time, making it practical even for very large numbers.

Practical Examples

Example 1: David's Tile Layout

David is tiling a rectangular floor that measures 48 inches by 60 inches. He wants to use the largest possible square tiles that fit perfectly without cutting. He needs to find the GCF of 48 and 60 to determine the tile size.

  • GCF(48, 60): 60 = 1 x 48 + 12, then 48 = 4 x 12 + 0
  • GCF = 12 inches
  • Number of tiles: (48/12) x (60/12) = 4 x 5 = 20 tiles

David should use 12-inch square tiles. He will need exactly 20 tiles to cover the entire floor with no cutting required. This is a classic application of GCF in construction and design.

Example 2: Sarah's Party Gift Bags

Sarah has 36 chocolates, 54 stickers, and 90 small toys. She wants to create identical gift bags using all items, with no items left over. The GCF tells her the maximum number of bags she can make.

  • GCF(36, 54) = 18, then GCF(18, 90) = 18
  • Maximum bags: 18
  • Per bag: 36/18 = 2 chocolates, 54/18 = 3 stickers, 90/18 = 5 toys

Sarah can make 18 identical gift bags, each containing 2 chocolates, 3 stickers, and 5 small toys, with nothing left over. Problems like these appear frequently in planning events, packaging, and distribution scenarios.

Example 3: Marcus Simplifies a Fraction

Marcus needs to simplify the fraction 84/126 for his homework. He uses the GCF to reduce it to lowest terms.

  • GCF(84, 126): 126 = 1 x 84 + 42, then 84 = 2 x 42 + 0
  • GCF = 42
  • 84/42 = 2, 126/42 = 3
  • Simplified fraction: 2/3

By dividing both 84 and 126 by their GCF of 42, Marcus simplifies the fraction to 2/3. This is the most reduced form because GCF(2, 3) = 1. Fraction simplification using GCF is a core skill in arithmetic and algebra, and extends to simplifying algebraic expressions and ratios.

Example 4: Emily's Music Scheduling

Emily has two songs: one that loops every 8 seconds and another every 12 seconds. She wants to know how often they start together. While LCM gives the loop period, the GCF reveals the timing structure.

  • GCF(8, 12) = 4 seconds
  • This means both loop cycles share a 4-second fundamental unit
  • Song 1 loops every 2 units, Song 2 every 3 units

The GCF of 4 seconds means the rhythmic patterns share a fundamental 4-second cycle. This is the basis for understanding rhythmic relationships in music theory, synchronization in engineering, and periodicity in physics. For the actual meeting point, Emily would use the LCM calculator to find they align every 24 seconds.

GCF Reference Table

Number Pair GCF Method Coprime?
12, 18 6 18 = 1x12+6, 12 = 2x6+0 No
24, 36 12 36 = 1x24+12, 24 = 2x12+0 No
7, 13 1 Both prime, no common factors Yes
100, 75 25 100 = 1x75+25, 75 = 3x25+0 No
48, 36, 60 12 GCF(48,36)=12, GCF(12,60)=12 No
8, 15 1 15 = 1x8+7, 8 = 1x7+1, 7 = 7x1+0 Yes
270, 192 6 270=1x192+78, 192=2x78+36, 78=2x36+6, 36=6x6+0 No

Tips and Complete Guide

Understanding the Euclidean Algorithm

The Euclidean algorithm, developed by the ancient Greek mathematician Euclid around 300 BCE, is one of the oldest algorithms still in widespread use. It works on a simple principle: GCF(a, b) = GCF(b, a mod b). By repeatedly taking remainders, the numbers get smaller until one reaches zero. The beauty of this algorithm is its efficiency — it requires at most 2 x log2(min(a, b)) steps, making it practical for numbers with thousands of digits. This efficiency is why it forms the backbone of many modern cryptographic systems, including RSA encryption.

GCF and Prime Factorization

An alternative to the Euclidean algorithm is finding GCF through prime factorization. Factor each number into its prime components, then multiply together the lowest powers of all shared primes. For example, 72 = 2^3 x 3^2 and 108 = 2^2 x 3^3. The shared primes are 2 and 3. Take the lower power of each: 2^2 and 3^2, giving GCF = 4 x 9 = 36. While intuitive, this method becomes impractical for large numbers because prime factorization is computationally expensive. The Euclidean algorithm is always preferred for efficiency. Explore prime factorization in detail with our prime factorization calculator.

Applications Beyond Mathematics

The GCF appears in many real-world contexts. In music, it determines the fundamental frequency of two combined signals. In manufacturing, it helps find the largest uniform piece size that avoids waste. In computer science, it is essential for reducing fractions in rational arithmetic libraries, computing modular inverses in cryptography, and determining pixel aspect ratios in graphics. The extended Euclidean algorithm, a variation that also finds coefficients satisfying Bezout's identity (ax + by = GCF(a, b)), is used directly in RSA key generation.

GCF in Algebra

In algebra, the concept of GCF extends to polynomials. Factoring out the GCF of all terms in a polynomial is typically the first step in simplification. For example, in 12x^3 + 18x^2 - 6x, the GCF of the coefficients is 6 and the GCF of the variable parts is x, so you factor out 6x to get 6x(2x^2 + 3x - 1). This technique is fundamental in solving equations, simplifying expressions, and finding roots of polynomials.

Common Mistakes to Avoid

  • Confusing GCF with LCM: The GCF is the largest shared factor (always less than or equal to the smaller number), while the LCM is the smallest shared multiple (always greater than or equal to the larger number). For 12 and 18: GCF = 6, LCM = 36.
  • Forgetting that GCF(a, 0) = a: The GCF of any number with 0 is the number itself, not 0. This is because every integer divides 0.
  • Skipping absolute values: The GCF is always positive. When working with negative numbers, use their absolute values first.
  • Stopping the Euclidean algorithm too early: Continue dividing until the remainder is exactly 0. The GCF is the last non-zero remainder, not any intermediate value.
  • Assuming coprime numbers have no relationship: Even when GCF = 1, the numbers may still share structural properties. Coprimality is itself an important mathematical property with applications in the Chinese Remainder Theorem and Euler's totient function.

Frequently Asked Questions

The Greatest Common Factor (GCF), also known as the Greatest Common Divisor (GCD) or Highest Common Factor (HCF), is the largest positive integer that divides two or more numbers without leaving a remainder. For example, the GCF of 12 and 18 is 6, because 6 is the largest number that divides evenly into both 12 and 18. The GCF is fundamental in simplifying fractions, solving problems in number theory, and is used extensively in algebra and cryptography.

The Euclidean algorithm finds the GCF by repeatedly applying division. To find GCF(a, b) where a > b: divide a by b and take the remainder r. Then replace a with b and b with r. Repeat until the remainder is 0 — the last non-zero remainder is the GCF. For example, GCF(48, 18): 48 = 2 x 18 + 12, then 18 = 1 x 12 + 6, then 12 = 2 x 6 + 0. So GCF(48, 18) = 6. This algorithm is efficient even for very large numbers and is the method our calculator uses. You can also use our <a href='/math/number-theory/prime-factorization-calculator' class='text-primary-600 hover:text-primary-800 underline'>prime factorization calculator</a> to find GCF through factoring.

The GCF (Greatest Common Factor) is the largest number that divides into all given numbers, while the LCM (Least Common Multiple) is the smallest number that all given numbers divide into. They are inversely related: for two numbers a and b, GCF(a, b) x LCM(a, b) = a x b. For example, with 12 and 18: GCF = 6 and LCM = 36, and indeed 6 x 36 = 216 = 12 x 18. Use our <a href='/math/number-theory/lcm-calculator' class='text-primary-600 hover:text-primary-800 underline'>LCM calculator</a> to find least common multiples.

Yes. When the GCF of two or more numbers is 1, those numbers are called coprime (or relatively prime). This means they share no common factors other than 1. For example, 8 and 15 are coprime because GCF(8, 15) = 1 — the factors of 8 are {1, 2, 4, 8} and the factors of 15 are {1, 3, 5, 15}, with only 1 in common. Consecutive integers are always coprime, and coprimality is important in modular arithmetic and RSA encryption.

To find the GCF of multiple numbers, apply the GCF operation iteratively. First find the GCF of the first two numbers, then find the GCF of that result with the third number, and continue for all remaining numbers. For example, GCF(12, 18, 24): GCF(12, 18) = 6, then GCF(6, 24) = 6. Our calculator supports entering as many numbers as you need, separated by commas, and shows each step of the process.

To simplify a fraction, divide both the numerator and denominator by their GCF. For example, to simplify 24/36: find GCF(24, 36) = 12, then divide both by 12 to get 2/3. This gives you the fraction in its lowest terms. The fraction cannot be simplified further because GCF(2, 3) = 1, meaning 2 and 3 are coprime. This technique is essential in algebra, ratio problems, and when working with proportions.

The GCF of any two different prime numbers is always 1, because prime numbers have no factors other than 1 and themselves. Since two distinct primes share no common factor besides 1, they are always coprime. For example, GCF(7, 13) = 1, GCF(23, 31) = 1, and GCF(2, 97) = 1. However, the GCF of a prime number with itself is the number itself: GCF(7, 7) = 7.

The GCF is always defined as a positive integer. When negative numbers are involved, you work with their absolute values. For example, GCF(-12, 18) = GCF(12, 18) = 6. Our calculator automatically handles negative inputs by taking absolute values, so you can enter negative numbers and still get the correct positive GCF.

Related Calculators

Disclaimer: This calculator is for informational and educational purposes only. Results are estimates and may not reflect exact values.

Last updated: February 23, 2026

Sources