Skip to main content

Calcu.fit

Greatest Common Factor (GCF) Calculator

Use this free calculator to find the greatest common factor (GCF) of two or more numbers. Type your numbers, separated by commas or spaces, and click Calculate. You get the GCF (also called the greatest common divisor, GCD, or highest common factor, HCF), the lists of factors, the prime factorization, the Euclidean algorithm steps, and the least common multiple (LCM). No signup needed.

Greatest common factor (GCF) calculator

Your numbers

Separate with commas, spaces or line breaks. GCF is also called GCD or HCF.

Greatest common factor
–

Step-by-step working

    Works with whole numbers and uses exact integer arithmetic. Factor lists and prime factorizations are shown for numbers up to 1,000,000,000,000. Check your own work for homework or exams.

    How to Use This GCF Calculator

    1. Enter two or more whole numbers, separated by commas, spaces, or line breaks. For example: 48, 180.
    2. Click Calculate.
    3. Read the GCF and the steps. Choose a method (listing factors, prime factorization, or the Euclidean algorithm) to see that method’s working.

    What You’ll See in Your Results

    • The greatest common factor (GCF, GCD, or HCF)
    • The factors of each number, with the common factors highlighted
    • The prime factorization of each number
    • The Euclidean algorithm steps
    • The least common multiple (LCM)
    • The numbers divided by the GCF, useful for simplifying fractions and ratios

    What Is the Greatest Common Factor?

    The greatest common factor of two or more numbers is the largest number that divides all of them exactly, with no remainder. It has several names:

    • GCF (greatest common factor)
    • GCD (greatest common divisor)
    • HCF (highest common factor)

    They all mean the same thing. For 12 and 18, the common factors are 1, 2, 3, and 6, and the greatest is 6.

    How to Find the GCF

    Method 1: List the Factors

    1. List all the factors of each number.
    2. Find the factors they share.
    3. Pick the largest one.

    Method 2: Prime Factorization

    1. Write each number as a product of prime numbers.
    2. Find the primes they have in common.
    3. Multiply the common primes, using the smallest power of each.

    Method 3: The Euclidean Algorithm

    1. Divide the larger number by the smaller number and find the remainder.
    2. Replace the larger number with the smaller number, and the smaller number with the remainder.
    3. Repeat until the remainder is 0. The last non-zero remainder is the GCF.

    This method is fast, even for very large numbers.

    The Formulas

    Euclidean algorithm: GCF(a, b) = GCF(b, a mod b), until the remainder is 0

    GCF of more than two numbers: GCF(a, b, c) = GCF(GCF(a, b), c)

    Relationship with the LCM: LCM(a, b) = (a × b) ÷ GCF(a, b)

    Simplifying a fraction: divide the numerator and the denominator by their GCF

    GCF Examples

    Example 1: List the Factors

    Find the GCF of 12 and 18.

    • Factors of 12: 1, 2, 3, 4, 6, 12
    • Factors of 18: 1, 2, 3, 6, 9, 18
    • Common factors: 1, 2, 3, 6
    • GCF = 6

    Example 2: Prime Factorization

    Find the GCF of 36 and 60.

    • 36 = 2² × 3²
    • 60 = 2² × 3 × 5
    • Common primes: 2² and 3 (the smallest power of each)
    • GCF = 2² × 3 = 4 × 3 = 12

    Example 3: The Euclidean Algorithm

    Find the GCF of 252 and 105.

    • 252 ÷ 105 = 2, remainder 42
    • 105 ÷ 42 = 2, remainder 21
    • 42 ÷ 21 = 2, remainder 0
    • The last non-zero remainder is 21, so GCF = 21

    Example 4: Larger Numbers

    Find the GCF of 1,071 and 462.

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

    Example 5: Three Numbers

    Find the GCF of 24, 36, and 60.

    • GCF(24, 36) = 12
    • GCF(12, 60) = 12
    • GCF = 12

    Example 6: Numbers with No Common Factor

    Find the GCF of 17 and 28.

    • 17 is prime, and 28 is not a multiple of 17.
    • GCF = 1

    When the GCF is 1, the numbers are called coprime (or relatively prime). They can be different, and they do not have to be prime themselves.

    Example 7: GCF and LCM

    For 12 and 18, the GCF is 6.

    • LCM = (12 × 18) ÷ 6 = 216 ÷ 6 = 36

    For 48 and 180, the GCF is 12 and the LCM is (48 × 180) ÷ 12 = 720.

    Example 8: Simplify a Fraction

    Simplify 48/180.

    • GCF(48, 180) = 12
    • 48 ÷ 12 = 4, and 180 ÷ 12 = 15
    • 48/180 = 4/15

    Dividing by the GCF gives the fraction in lowest terms in one step.

    Example 9: Simplify a Ratio

    Simplify the ratio 24 : 36.

    • GCF(24, 36) = 12
    • 24 ÷ 12 = 2, and 36 ÷ 12 = 3
    • The ratio is 2 : 3

    Example 10: Equal Groups

    You have 24 apples and 36 oranges. You want identical gift bags with no fruit left over. What is the largest number of bags?

    • GCF(24, 36) = 12 bags
    • Each bag has 24 ÷ 12 = 2 apples and 36 ÷ 12 = 3 oranges.

    Example 11: Square Tiles

    A floor is 120 cm by 84 cm. What is the largest square tile that fits with no cutting?

    • GCF(120, 84) = 12 cm
    • The tiles fit 120 ÷ 12 = 10 along the length and 84 ÷ 12 = 7 along the width, so you need 10 × 7 = 70 tiles.

    Example 12: Special Cases

    • GCF(0, 9) = 9, because every number divides 0
    • GCF(7, 7) = 7
    • GCF(1,000, 250) = 250, because 250 divides 1,000 exactly
    • GCF(144, 96, 60) = 12

    GCF vs. LCM

     GCFLCM
    Stands forGreatest common factorLeast common multiple
    What it isThe largest number that divides all the numbersThe smallest number that all the numbers divide
    SizeLess than or equal to the smallest numberGreater than or equal to the largest number
    Used forSimplifying fractions, equal groupsAdding fractions, repeating events
    Example for 12 and 18636

    Where Is the GCF Used?

    • Simplifying fractions and ratios to lowest terms
    • Splitting things into equal groups with nothing left over
    • Cutting or tiling with the largest equal pieces
    • Factoring numbers and algebra expressions
    • Cryptography and computer science, where the Euclidean algorithm is a core tool

    Tips for Finding the GCF

    • For small numbers, listing factors is quick.
    • For larger numbers, use the Euclidean algorithm. It needs only a few divisions.
    • Use prime factorization when you also need the LCM or want to understand the structure of the numbers.
    • If one number divides the other, the smaller number is the GCF.
    • If one number is 1, the GCF is 1.
    • Two even numbers always have a GCF of at least 2.
    • Check your answer: the GCF should divide every number exactly.
    • To find the GCF of three or more numbers, find the GCF of two, then the GCF of that result and the next number.

    GCF Calculator vs. Other Tools

    • LCM Calculator: the least common multiple.
    • Prime Factorization Calculator: write a number as a product of primes.
    • Fraction Simplifier: reduce a fraction to lowest terms.
    • Ratio Calculator: simplify and compare ratios.
    • Factor Calculator: list all factors of a number.
    • Scientific Calculator: general math and functions.

    Frequently Asked Questions (FAQ)

    What is the greatest common factor?

    The largest number that divides two or more numbers exactly, with no remainder. The GCF of 12 and 18 is 6.

    Yes. Greatest common factor (GCF), greatest common divisor (GCD), and highest common factor (HCF) are three names for the same thing.

    List the factors of each number and pick the largest one they share, use prime factorization, or use the Euclidean algorithm. For 12 and 18, the GCF is 6.

    A fast method that repeatedly replaces the larger number with the remainder after dividing by the smaller number, until the remainder is 0. The last non-zero remainder is the GCF.

    Find the GCF of the first two numbers, then find the GCF of that result and the third number. For 24, 36, and 60, the GCF is 12.

     1, if they are different primes. If they are the same prime, the GCF is that prime.

    The number itself. GCF(0, 9) = 9.

    The numbers are coprime (relatively prime). They share no factors other than 1.

    Divide the top and the bottom by their GCF. For 48/180, the GCF is 12, so the fraction simplifies to 4/15.

    For two numbers, LCM × GCF = the product of the numbers. For 12 and 18, 36 × 6 = 216 = 12 × 18.

     No. The GCF is never larger than the smallest of the numbers (ignoring 0).

    Yes. It is free, with no registration and no limits.

    It uses exact integer arithmetic, so the result is exact for whole numbers.

    Disclaimer

    This calculator is for general informational and educational purposes only. It works with whole numbers. Check your own work when you use the results for homework, exams, or other important tasks.