Skip to main content

Greatest common factor & divisor

Greatest Common Factor Calculator

Find the greatest common factor of two or more positive integers (also called the greatest common divisor); show your work with prime factorization or the Euclidean algorithm. Positive integers only.

By Jeff Beem

Updated

Numbers

Enter two or more positive integers separated by commas. The greatest common factor (GCF) is the largest positive integer that divides all of them.

Result
Greatest Common Factor (GCF)8

Show your work

Each number as a product of primes. The GCF is the product of the lowest power of each prime common to all.

  • 16=2^4
  • 88=2^3 × 11
  • 104=2^3 × 13

Common primes (min exponent):2^3 = 8

How to use this calculator

Enter comma-separated positive integers in Numbers (default 16, 88, 104). The results card shows the greatest common factor (GCF). Under Show your work, switch between Prime factorization method and Euclidean algorithm to see steps; both views match the headline value. Non-numeric text is ignored; zero and duplicates are skipped.

Reading your GCF result

The dark results card prints the greatest common factor (also called the greatest common divisor). Expand Show your work and switch between prime factorization and Euclidean views; both methods must agree on the final number.

Worked examples at the defaults

Example: Default list → GCF(16, 88, 104) = 8

Default input is 16, 88, 104. Prime view lists 16 = 2⁴, 88 = 2³ × 11, 104 = 2³ × 13, then Common primes (min exponent): 2³ = 8. Euclidean view chains GCF(16, 88) then GCF(8, 104), ending at 8 in the step trace.

Pairwise Euclidean trace (two or more numbers)

With two integers such as 48, 18, the Euclidean panel shows one remainder chain. With three or more, the preformatted trace labels each round (for example GCF(16, 88), then Next: GCF(8, 104)) so you can follow how the widget folds the list.

What the parser ignores

The textarea accepts comma-separated text; non-numeric characters are stripped, and zero and duplicate values are skipped. If nothing valid remains, the result panel shows Enter numbers to see GCF instead of a value.

Greatest Common Factor Calculator: GCF & GCD Solver

This calculator finds the greatest common factor (GCF), also called the greatest common divisor (GCD), of two or more positive integers using prime factorization or the Euclidean algorithm in Show your work. Positive integers only; runs locally in your browser.

What this calculator does

The widget returns the greatest common factor (GCF) of two or more positive integers you enter comma-separated in the numbers field. Under Show your work, you can display either prime factorization (minimum exponents on shared primes) or the Euclidean algorithm (remainder chain). The parser ignores non-numeric characters and skips zero and duplicates. It does not accept decimals, fractions, polynomials, or lists of every common factor (not just the greatest).
  • Prime method:
    GCF(a,b)=pimin(ea,i,eb,i)\text{GCF}(a, b) = \prod p_i^{\,\min(e_{a,i},\, e_{b,i})}
  • Euclidean (two numbers):
    GCF(a,b)=GCF(b,  amodb) until remainder 0\text{GCF}(a, b) = \text{GCF}(b,\; a \bmod b)\ \text{until remainder } 0
  • Three or more:
    GCF(a,b,c)=GCF(GCF(a,b),c)\text{GCF}(a, b, c) = \text{GCF}(\text{GCF}(a, b), c)

How the math works

Start with the default list 16, 88, 104. In prime factorization view, the widget factors each value: 16 = 2⁴, 88 = 2³ × 11, and 104 = 2³ × 13. The only prime common to all three is 2, and the smallest exponent among them is 3, so the GCF is 2³ = 8, shown in the results headline and in the “Common primes” line.
The Euclidean view on the same list first finds GCF(16, 88) = 8, then GCF(8, 104) = 8. For a two-number check, GCF(24, 36) follows 36 = 24 × 1 + 12 and 24 = 12 × 2 + 0, so the GCF is 12. Prime factorization on 24 and 36 gives 2² × 3¹—the same answer by a different route.
Prime factorization is visual for classroom-sized integers; the Euclidean algorithm avoids full factorization and stays efficient on larger values because each step shrinks the problem via remainders. Toggle either button under Show your work; the headline GCF does not change. Results stay within JavaScript safe integer range.

Limits of the model

This tool is for positive whole numbers only. It does not reduce fractions to lowest terms on the page—confirm the GCF here, then apply it to numerator and denominator yourself (for example 18/24 with GCF 6 becomes 3/4). For all common factors of a set, or factor trees on a single integer, use a different tool from the related list below.

Greatest Common Factor Calculator FAQ

Is GCF the same as GCD?

Yes. Greatest Common Factor (GCF) and Greatest Common Divisor (GCD) name the same value: the largest positive integer that divides every number in your list with no remainder. The results panel labels it Greatest Common Factor (GCF).

What is the Euclidean algorithm in Show your work?

Repeated division: GCF(a, b) = GCF(b, a mod b) until the remainder is 0; the last non-zero divisor is the GCF. Click Euclidean algorithm under Show your work to see each remainder line for your inputs.

Can you find GCF for three or more numbers?

Yes. Enter comma-separated integers in the numbers field (default: 16, 88, 104). The widget chains pairwise: GCF(a, b, c) = GCF(GCF(a, b), c). Each intermediate GCF pairs with the next integer until one value remains.

How does the prime factorization method work for GCF?

Click Prime factorization method under Show your work. The widget writes each input as a product of primes and multiplies shared primes at the smallest exponent found in any input. For defaults: 16 = 2⁴, 88 = 2³ × 11, 104 = 2³ × 13 → GCF = 2³ = 8.

Why only positive integers?

GCF is defined on positive integers. The parser strips non-numeric text and skips zero and duplicates. Enter at least one positive integer or the result panel stays empty.

How is GCF used to simplify fractions?

Divide numerator and denominator by their GCF. Example: 18/24 → GCF(18, 24) = 6 → 3/4. This page returns the GCF only; it does not display the reduced fraction.

What if I enter only one number?

With a single positive integer in the list, the widget treats the GCF as that number itself (the only divisor shared with itself). You still need at least one parsed integer to fill the result panel.

Do both work methods always agree?

Yes. Prime factorization method and Euclidean algorithm are two views of the same result. Switching buttons under Show your work changes the steps displayed, not the headline GCF in the dark results card.

Mathematical Reference Note

Calculation Logic: This tool uses standard mathematical algorithms. While we strive for accuracy, errors in logic or user input can result in incorrect data.

Verification: Results should be cross-checked if used for important academic, professional, or personal calculations.

Standard Terms: This tool is provided free of charge and as-is. CalcRegistry provides no warranty regarding the accuracy or fitness of these results for your specific needs.

© 2026 CalcRegistry Reference Last System Check: July 2026Free Online Utility Tools