How to find the greatest common factor
Enter two or more integers to find their greatest common factor (GCF), also called the greatest common divisor (GCD). Negative inputs are converted to absolute values, and the result includes the calculation steps.
Enter integers and calculate the GCF
Use Integers (comma or space separated). Separate values with commas or spaces. Optional plus and minus signs are accepted.
- Enter at least two integers.
- Select Calculate.
- Review the result in 2. Result.
Review the result and calculation steps
Formula & steps shows the Euclidean-algorithm work used to reach the result. When you enter more than two numbers, the calculator processes them pairwise.
- Select Copy result to copy the result as plain text. If the copy operation fails, the interface may show Could not copy - select and copy manually.
- Select Download result (.txt) to save the entered numbers, formula, result, and steps as plain text. The downloaded file is named
greatest-common-factor-calculator-result.txt.
Reset the calculator
Select Reset to clear the input, clear the displayed error, and hide the current result. Reset does not recalculate or preserve the current result.
Input limits and validation
The calculator accepts up to 50 integers, with no more than 100 digits in each integer. It rejects empty input, fewer than two values, invalid tokens, values over the digit limit, and more than 50 integers. An input containing only zeros is also rejected because GCF(0, 0, ...) is undefined.
Calculation method and browser processing
The calculator uses the Euclidean algorithm and exact JavaScript BigInt arithmetic in your browser. The calculation uses the values entered into this tool. The surrounding page also loads analytics and subscription-related code, so this local calculation behavior does not establish a broader site-wide privacy or data-transmission guarantee.
Frequently Asked Questions
What is the greatest common factor (GCF)?
The greatest common factor (GCF), also called the greatest common divisor (GCD), of two or more integers is the largest positive integer that divides every one of them with no remainder. For example, the GCF of 12 and 18 is 6.
Is GCF the same as GCD?
Yes. "Greatest common factor" (GCF) and "greatest common divisor" (GCD) refer to the exact same value - the largest integer that divides all the given numbers evenly. GCF is more common in school arithmetic, GCD in higher mathematics and computing.
How is the GCF calculated?
This calculator uses the Euclidean algorithm: for two numbers a and b, repeatedly replace the larger number with the remainder of dividing it by the smaller number until the remainder is 0. The last nonzero remainder is the GCF. For more than two numbers, the GCF is found pairwise: GCF(a, b, c) = GCF(GCF(a, b), c).
What is the GCF of two numbers that share no common factors?
If two integers share no common factor other than 1, their GCF is 1 and they are called coprime (or relatively prime) - for example, GCF(8, 15) = 1.
What is GCF(0, n)?
By definition, this calculator returns GCF(0, n) = |n| for any nonzero integer n because it converts negative inputs to their absolute values. GCF(0, 0) is undefined and is not computed by this tool.