Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

GCF Calculator


How to use GCF Calculator
  1. Pick the method under Calculation Method: Euclidean Algorithm or Prime Factorization; the panel on the right explains the chosen one. Learn more about the methods
  2. Type whole numbers in Number 1 and Number 2. Learn more about the inputs
  3. Click + Add Number for a third to sixth number; the red × beside a field removes it. Learn more about fields
  4. Click Calculate; the greatest common factor appears in the result box. Learn more about the result
  5. A red message appears when fewer than two fields hold a non-zero whole number; blanks, decimals and zeros are skipped. Learn more about messages
  6. Click Reset to clear the result and return to two empty fields. Learn more about Reset
?
?
GCF Result:
—
The Euclidean algorithm finds the GCF by repeatedly dividing and taking remainders. It's the most efficient method for finding the greatest common factor of two or more numbers. Learn more about the Euclidean algorithm































Getting Started with the GCF Calculator

DemoTwo numbers, a third one, then Reset
Step 0 of 5
The GCF calculator helps you find the greatest common factor of two or more numbers. Start by choosing your calculation method using the radio buttons at the top: Euclidean Algorithm (faster for large numbers) or Prime Factorization (shows how it works).

Enter your first number in the "Number 1" field and your second number in the "Number 2" field. The calculator accepts positive integers of any size. Try simple examples like finding the GCF of 1212 and 1818, or larger numbers like 144144 and 9696.

To find the GCF of more than two numbers, click the + Add Number button below the input fields. You can add up to 66 numbers total. Each additional field will appear with its own input box and a remove button (×) if you want to delete it later.

After entering your numbers, click the blue Calculate button. The GCF result appears in the result box below the inputs: GCF(144144, 9696) = 4848, and adding 6060 as a third number gives 1212. The calculator works instantly, even with large numbers. Use Reset to clear all fields and start fresh with two empty fields. What the result means is explained in what is the greatest common factor.

Using the Euclidean Algorithm Method

DemoGCF(48, 18) and GCF(1071, 462)
Step 0 of 4
Select Euclidean Algorithm as your calculation method for the fastest GCF computation. This ancient method uses division and remainders to find the GCF efficiently without breaking numbers into prime factors. It works especially well for large numbers.

The algorithm repeatedly divides the larger number by the smaller number, then replaces the larger number with the smaller and the smaller with the remainder. This continues until the remainder is 00. Try finding GCF(4848, 1818): divide 48÷18=248 ÷ 18 = 2 remainder 1212, then 18÷12=118 ÷ 12 = 1 remainder 66, then 12÷6=212 ÷ 6 = 2 remainder 00. The GCF is 66.

The division steps of each pair are listed under the result. For more than two numbers, the calculator applies this method repeatedly. It finds GCF(first, second), then finds GCF(result, third), and so on. Enter 1212, 1818, and 2424 to see this in action—the GCF is 66 because it divides evenly into all three numbers.

This method is mathematically proven to always find the correct GCF. It's faster than prime factorization for numbers with hundreds or thousands of digits, making it the preferred method for computational efficiency in computer science and cryptography. A larger example: GCF(10711071, 462462) = 2121 after three divisions. The division chain is written out in how the Euclidean algorithm works.

Using the Prime Factorization Method

DemoPrime Factorization mode
Step 0 of 4
Switch to Prime Factorization mode to read how GCF works through prime factors: the panel on the right explains the method, and the result box shows the same GCF as the Euclidean method. This method breaks each number into its prime building blocks, then multiplies the common primes together. Under the result the calculator lists the factorization of every number and the lowest power of each shared prime; the method is explained further in how prime factorization finds the GCF.

For example, to find GCF(1212, 1818): Break 12=2×2×312 = 2 × 2 × 3 and 18=2×3×318 = 2 × 3 × 3. The common prime factors are one 22 and one 33, so GCF = 2×3=62 × 3 = 6. The calculator performs this factorization automatically for any numbers you enter.

This method clearly shows which prime factors the numbers share. Try GCF(2424, 3636): 24=2×2×2×324 = 2 × 2 × 2 × 3 and 36=2×2×3×336 = 2 × 2 × 3 × 3. Common factors are 2×2×3=122 × 2 × 3 = 12. You take the lowest power of each common prime.

Prime factorization is excellent for learning and understanding GCF conceptually. It connects to other number theory topics like LCM (least common multiple), simplifying fractions, and finding common denominators. The method works perfectly for small to medium-sized numbers.

Adding and Removing Number Fields

DemoFour fields, then remove one
Step 0 of 4
The calculator starts with two input fields, but you can find the GCF of up to 66 numbers. Click the + Add Number button (with dashed border) below your current inputs to add another field. A new input box appears labeled "Number 3", "Number 4", etc.

Each additional field includes a small × button on the right side. Click this red × button to remove that specific number field. You cannot remove fields if you only have two remaining—the calculator always requires at least two numbers to compute a GCF.

Adding multiple numbers is useful for real-world problems. For instance, if you're arranging 1212, 1818, 2424, and 3030 items into equal groups, the GCF tells you the largest possible group size: 66 items per group. Try entering these numbers to verify.

The calculator processes all numbers using the Euclidean algorithm repeatedly. GCF(aa, bb, cc) = GCF(GCF(aa, bb), cc). This means finding the GCF of three numbers is just finding the GCF of two numbers, then finding the GCF of that result with the third number. Removing a field does not recompute: the old result stays until you click Calculate again, so 1212, 1818, 88 gives 22 only after a new click. Why this chaining is valid is explained in how the Euclidean algorithm works.

Understanding the GCF Result

DemoCoprime, highly related, negative
Step 0 of 3
After clicking Calculate, the GCF result appears in the white result box. The number shown is the largest integer that divides evenly into all your input numbers. For GCF(1212, 1818) = 66, this means 66 is the biggest number that goes into both 1212 and 1818 with no remainder.

If you get GCF = 11, your numbers are relatively prime or coprime. They share no common factors except 11. Try GCF(77, 1515) = 11, or GCF(88, 99) = 11. These pairs have no common divisors, making them useful in fraction simplification and cryptography.

Large GCF values indicate numbers with many shared factors. GCF(2424, 3636) = 1212 shows these numbers are highly related—they're both multiples of 1212. In contrast, GCF(2525, 3636) = 11 shows these numbers share nothing except 11.

The GCF result is always positive, even when you enter negative numbers: the calculator uses their absolute values. Mathematically, GCF(−12-12, 1818) = GCF(1212, 1818) = 66 because divisibility properties are the same for negative numbers. Coprime numbers and the other properties behind these results are in what is the greatest common factor.

Reading Error Messages

DemoDecimal, zero and a blank
Step 0 of 4
The calculator validates your input before computing. If you see "Error: Enter at least 2 valid integers" in red text, you either left a field empty, entered fewer than two numbers, or typed non-numeric characters like letters or symbols.

Make sure each number field contains a whole number. The calculator accepts integers only—no decimals or fractions; negative integers are allowed and their sign is ignored. A decimal such as 12.512.5 is skipped like a blank field, so 1212 and 12.512.5 leave only one valid number and you get the error.

If a number field is blank when you click Calculate, the calculator ignores that field. This means if you have six fields but only filled three, it computes GCF using just those three numbers. Remove unnecessary blank fields with the × button for cleaner results.

A field holding 00 is skipped like a blank one, so 00 and 1818 also give the error. Mathematically GCF(00, nn) = nn, since every number divides 00, but the calculator works only with non-zero integers. Keep all inputs as non-zero whole numbers. The definition the messages protect is in what is the greatest common factor.

What is the Greatest Common Factor

The greatest common factor (GCF), also called greatest common divisor (GCD) or highest common factor (HCF), is the largest positive integer that divides evenly into two or more numbers. For GCF(1212, 1818) = 66, the number 66 is the biggest integer that goes into both 1212 and 1818 with zero remainder.

Think of GCF as finding the biggest building block shared by multiple numbers. The numbers 1212 and 1818 can both be built from groups of 66: 12=6×212 = 6 × 2 and 18=6×318 = 6 × 3. You cannot use groups of 77 or larger because those won't divide both numbers evenly.

GCF is fundamental to fraction simplification. To reduce 1218\frac{12}{18}, divide numerator and denominator by GCF(1212, 1818) = 66 to get 23\frac{2}{3}. This is why GCF is essential in elementary arithmetic and algebra.

Common factors are the divisors shared by all numbers. For 1212 and 1818, the common factors are 1,2,3,61, 2, 3, 6. The greatest of these common factors is 66. Finding the GCF efficiently requires algorithms like Euclid's or prime factorization rather than listing all factors.

The definition and notation are in what is GCD and basic properties; listing factors is method 1 and common factors are treated in common factors. Pairs with GCF 11 are covered in coprime numbers.

How the Euclidean Algorithm Works

The Euclidean algorithm rests on one fact: for integers a>b>0a > b > 0, GCF(aa, bb) = GCF(bb, a mod ba \bmod b). Any common divisor of aa and bb also divides the remainder a−qba - qb, and any common divisor of bb and the remainder divides aa. So the pair (a,b)(a, b) can be replaced by the smaller pair (b,r)(b, r) without changing the GCF.

For 4848 and 1818: 48=2×18+1248 = 2 × 18 + 12, then 18=1×12+618 = 1 × 12 + 6, then 12=2×6+012 = 2 × 6 + 0. The last non-zero remainder, 66, is the GCF. For 10711071 and 462462: 1071=2×462+1471071 = 2 × 462 + 147, 462=3×147+21462 = 3 × 147 + 21, 147=7×21+0147 = 7 × 21 + 0, so GCF = 2121.

The remainders shrink at every step, so the algorithm always stops, and it needs at most about 55 times the number of digits of the smaller number in divisions. That is why the calculator uses it to compute every result; in Prime Factorization mode it additionally shows the factorizations, and in Euclidean Algorithm mode it lists the division steps under the result.

For three or more numbers the calculator chains the pair rule: GCF(aa, bb, cc) = GCF(GCF(aa, bb), cc). The algorithm is presented in method 3: Euclidean algorithm and traced in Euclidean algorithm step by step; the chaining is justified in GCD of more than two numbers.

How Prime Factorization Finds the GCF

Every integer greater than 11 is a product of primes in exactly one way. Write each number as such a product, then keep every prime that appears in all of them, raised to the lowest power it has in any of them. The product of these kept powers is the GCF.

For 12=22×312 = 2^2 × 3 and 18=2×3218 = 2 × 3^2: the prime 22 appears with powers 22 and 11, so keep 212^1; the prime 33 appears with powers 11 and 22, so keep 313^1. GCF = 2×3=62 × 3 = 6. For 24=23×324 = 2^3 × 3 and 36=22×3236 = 2^2 × 3^2: keep 222^2 and 313^1, so GCF = 1212.

A prime missing from one of the numbers is dropped: 25=5225 = 5^2 and 36=22×3236 = 2^2 × 3^2 share no prime, so GCF = 11 and the numbers are coprime. The same factorizations give the LCM by keeping the highest powers instead, which is why GCF × LCM = a×ba × b for two numbers.

Factoring large numbers is slow, so this method suits small and medium inputs and is mainly a way to see why the answer is what it is. The method is set out in method 2: prime factorization and compared with the others in summary: three methods for GCD.

Applications of GCF

Simplifying Fractions: Reduce fractions to lowest terms by dividing numerator and denominator by their GCF. The fraction 2436\frac{24}{36} simplifies to 23\frac{2}{3} because GCF(2424, 3636) = 1212, and 24÷1236÷12=23\frac{24÷12}{36÷12} = \frac{2}{3}.

Dividing Items into Groups: If you have 1212 apples and 1818 oranges and want to make identical fruit baskets, GCF(1212, 1818) = 66 tells you the maximum number of baskets: 66 baskets with 22 apples and 33 oranges each.

Finding Common Denominators: When adding fractions like 112+118\frac{1}{12} + \frac{1}{18}, you need the least common multiple (LCM), which connects to GCF through the formula: LCM(aa, bb) × GCF(aa, bb) = a×ba × b.

Tiling and Design: If you're tiling a 2424 inch by 3636 inch rectangle with square tiles, GCF(2424, 3636) = 1212 tells you the largest square tile size that fits perfectly: 1212 inch × 1212 inch tiles with no cutting or waste.

More uses are collected in applications of GCD and worked examples.

GCF vs LCM

GCF (greatest common factor) finds the largest number that divides into all inputs. LCM (least common multiple) finds the smallest number that all inputs divide into. These are inverse concepts that work together in number theory.

For GCF(1212, 1818) = 66 and LCM(1212, 1818) = 3636, notice that 6×36=216=12×186 × 36 = 216 = 12 × 18. This relationship always holds: GCF(aa, bb) × LCM(aa, bb) = a×ba × b for any two positive integers aa and bb.

Use GCF when dividing or reducing: simplifying fractions, splitting items into equal groups, finding common factors. Use LCM when combining or building up: adding fractions with different denominators, finding common multiples, scheduling repeating events.

Think of GCF as "breaking down" to find shared divisors, while LCM is "building up" to find common multiples. For 44 and 66: GCF = 22 (largest shared divisor), LCM = 1212 (smallest shared multiple). Both concepts use the same prime factorization but apply it differently.

The product rule is proved in the GCD–LCM relationship, LCM itself is defined in what is LCM, and the coprime case, where LCM is the plain product, in when a and b are coprime.