# What is the GCF of my numbers?

Finds the greatest common factor (GCF) of two or more numbers, exactly, however large they are.

- Page: https://www.acalculator.org/math/gcf-calculator
- JSON spec: https://www.acalculator.org/math/gcf-calculator.json
- Version: 25bdd333eabf

## Default answer

Example with the default inputs (Your numbers [12, 18, 24]): The greatest common factor of 12, 18 and 24 is 6.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| input | Your numbers | Two or more numbers, separated by commas, spaces, semicolons, or new lines. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| gcf | Greatest common factor | The largest number that divides every number in the list a whole number of times. |
| numbers | Numbers | The numbers as read from the list, written without thousands separators. |
| note | Decimals | Shown when a number has decimals: how the GCF of decimals is found. |

## Method

Euclid’s algorithm on the whole numbers, GCF(a, b, c) = GCF(GCF(a, b), c); decimals are scaled by a power of ten.

## Assumptions

- Negative numbers count by their absolute value: GCF(−12, 18) = 6.
- A 0 in the list does not change the GCF: GCF(0, 5) = 5. The GCF of only zeros is 0.
- Decimals are exact as typed: every number is multiplied by the same power of ten to make it whole, and the GCF is divided by it again.
- Whole numbers keep every digit. Very large numbers typed in the box are read as 64-bit floats, so enter whole numbers below 9,007,199,254,740,992 (2^53) to keep them exact.

## Worked examples

1. input = 12 or 18 gives gcf = 6. Source: OpenStax, Elementary Algebra 2e, §7.1 Greatest Common Factor and Factor by Grouping. https://openstax.org/books/elementary-algebra-2e/pages/7-1-greatest-common-factor-and-factor-by-grouping.
2. input = 1,071 or 462 gives gcf = 21. Source: OpenStax, Elementary Algebra 2e, §7.1 Greatest Common Factor and Factor by Grouping. https://openstax.org/books/elementary-algebra-2e/pages/7-1-greatest-common-factor-and-factor-by-grouping.
3. input = 17 or 19 gives gcf = 1. Source: OpenStax, Elementary Algebra 2e, §7.1 Greatest Common Factor and Factor by Grouping. https://openstax.org/books/elementary-algebra-2e/pages/7-1-greatest-common-factor-and-factor-by-grouping.
4. input = 2.5 or 5 gives gcf = 2.5. Source: OpenStax, Elementary Algebra 2e, §7.1 Greatest Common Factor and Factor by Grouping. https://openstax.org/books/elementary-algebra-2e/pages/7-1-greatest-common-factor-and-factor-by-grouping.
5. input = -12 or 18 gives gcf = 6. Source: OpenStax, Elementary Algebra 2e, §7.1 Greatest Common Factor and Factor by Grouping. https://openstax.org/books/elementary-algebra-2e/pages/7-1-greatest-common-factor-and-factor-by-grouping.

## FAQ

### What is the Greatest Common Factor (GCF)?

The Greatest Common Factor (GCF) of two or more numbers is the largest positive integer that divides all the given numbers evenly without leaving a remainder. For example, the GCF of 12 and 18 is 6, because 6 is the largest number that divides both 12 and 18 evenly.

### How do you find the GCF of two numbers?

The most efficient method is the Euclidean algorithm: repeatedly divide the larger number by the smaller number and take the remainder, then continue with the smaller number and the remainder until the remainder is 0. The last non-zero remainder is the GCF. For example, to find GCF(48, 18): 48 ÷ 18 = 2 remainder 12, then 18 ÷ 12 = 1 remainder 6, then 12 ÷ 6 = 2 remainder 0, so GCF = 6.

### How do you find the GCF of more than two numbers?

For multiple numbers, use the associative property: GCF(a, b, c) = GCF(GCF(a, b), c). Find the GCF of the first two numbers, then find the GCF of that result with the third number, and so on.

### What's the difference between GCF and LCM?

GCF (Greatest Common Factor) is the largest number that divides all given numbers evenly, while LCM (Least Common Multiple) is the smallest number that is a multiple of all given numbers. They are related by the formula: LCM(a, b) × GCF(a, b) = a × b, for positive a and b.

### Can you find the GCF of negative numbers?

GCF is typically defined for positive integers. For negative numbers, you find the GCF of their absolute values, and this calculator does that: GCF(−12, 18) = 6.

### What are some real-world applications of GCF?

GCF is used in simplifying fractions (dividing numerator and denominator by their GCF), scheduling (finding common intervals), engineering (finding optimal gear ratios), and computer science (finding efficient algorithms and data structures).

### How does prime factorization help find GCF?

Prime factorization can be used to find GCF by taking each prime factor to its lowest power across all numbers. For example, for 12 (2²×3) and 18 (2×3²), the GCF is 2×3 = 6, using the lowest power of each prime factor.

### What's the relationship between GCF and simplifying fractions?

GCF is essential for simplifying fractions. To simplify a fraction, divide both the numerator and denominator by their GCF. For example, to simplify 12/18, find GCF(12, 18) = 6, then 12/18 = (12÷6)/(18÷6) = 2/3.

### Can the GCF be larger than the smallest number?

No, for positive numbers the GCF is always less than or equal to the smallest number in the set. The GCF equals the smallest number only when all other numbers are multiples of the smallest number.

### How do you verify if a number is the correct GCF?

To verify, check that the number divides all the original numbers evenly and that no larger positive number has this property. You can also use the relationship: LCM(a, b) × GCF(a, b) = a × b (for positive a and b) to verify your result.

### Can I find the GCF of decimals?

Yes. Multiply every number by the same power of ten so that all of them are whole numbers, find the GCF of those, then divide by the same power of ten. For example, for 2.5 and 5: multiply by 10 to get 25 and 50, whose GCF is 25, so the GCF of 2.5 and 5 is 2.5.

## Sources

- OpenStax, Elementary Algebra 2e, §7.1 Greatest Common Factor and Factor by Grouping. https://openstax.org/books/elementary-algebra-2e/pages/7-1-greatest-common-factor-and-factor-by-grouping
