GCF Calculator
Type two or more numbers. You get the greatest common factor, worked out two ways, plus the fraction in lowest terms.
https://flxcode.com/gcf-calculator/
Example
The greatest common factor of 48, 180 is 12.
Euclid’s method
GCF(48, 180): 180 = 3 × 48 + 36 48 = 1 × 36 + 12 36 = 3 × 12 + 0 the last nonzero remainder is 12
Prime factor method
- 48 = 2⁴ × 3
- 180 = 2² × 3² × 5
- Primes in every number, lowest power: 2² × 3 = 12
Where this helps
- Divide both by 12: 48 ÷ 12 = 4 and 180 ÷ 12 = 15.
- So 48/180 in lowest terms is 4/15.
- The LCM of the same numbers is 720.
No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it.
Problem or idea? Email us
Worked examples
| Numbers | GCF | Note |
|---|---|---|
| 48, 180 | 12 | The default: 48/180 reduces to 4/15 |
| 12, 18, 24 | 6 | Three numbers |
| 17, 5 | 1 | Two primes: nothing shared but 1 |
| 84, 126 | 42 | A pair for simplifying 84/126 |
| 1071, 462 | 21 | Euclid's classic example |
| 1000000, 250000 | 250,000 | One divides the other |
Why Euclid's method works
Any number that divides both a and b also divides the remainder of a ÷ b, because the remainder is a minus a multiple of b. So the pair (a, b) and the pair (b, remainder) have exactly the same common factors. The numbers shrink every step, so you reach a remainder of 0 fast. Even for 15-digit numbers it takes under 100 steps. The method is over 2,000 years old.
Which method should I use?
Euclid's is faster for big numbers and needs no factoring. The prime factor method is easier to see and is what most classes ask for. The tool shows both, and they must agree. If they differ, one of your inputs is mistyped.
Where the GCF shows up
- Reducing fractions. See also the LCM calculator for the common denominator when you add them.
- Splitting things into equal groups. 48 red and 180 blue beads can make at most 12 identical bags.
- The relation GCF × LCM = product, which holds for two numbers: 12 × 720 = 48 × 180 = 8640.
To see all the factors a pair shares, open the factor calculator. For the prime pieces of each number, the prime factorization calculator draws a factor tree.
Numbers this uses
- Input: 2 to 12 whole numbers, each up to 1,000,000,000,000,000 (1e15), separated by commas, spaces or semicolons.
- Prime method: shown when every number can be factored within the time cap. Euclid's is always shown.
- Negative numbers use their size. A 0 is allowed with at least one number above 0.
Nothing you type is uploaded. We count events without cookies (details).
FAQ
What is the greatest common factor?
The largest whole number that divides every number in the list with no remainder. For 48 and 180 it is 12. It is also called the GCD (greatest common divisor) or HCF (highest common factor). They are the same thing.
How do I find the GCF with Euclid's method?
Divide the bigger number by the smaller one and keep the remainder. Then divide the smaller by that remainder, and repeat until the remainder is 0. The last nonzero remainder is the GCF. For 180 and 48: 180 = 3 × 48 + 36, 48 = 1 × 36 + 12, 36 = 3 × 12 + 0, so the GCF is 12.
How do I find the GCF with prime factors?
Write each number as primes: 48 = 2⁴ × 3 and 180 = 2² × 3² × 5. Take each prime they share with the lowest exponent: 2² and 3. Multiply: 4 × 3 = 12.
How do I find the GCF of three or more numbers?
Find the GCF of the first two, then the GCF of that result and the third, and so on. The GCF of 12, 18 and 24 is GCF(GCF(12, 18), 24) = GCF(6, 24) = 6. The tool shows each step.
How do I use the GCF to simplify a fraction?
Divide the top and bottom by the GCF. 48/180: GCF is 12, so it becomes 4/15. When the GCF is 1 the fraction is already in lowest terms. For two numbers the tool adds this line.
What if the GCF is 1?
The numbers are called coprime or relatively prime. 17 and 5 are coprime, and so are 8 and 15, even though 8 and 15 are not prime themselves.
What is the GCF of a number and 0?
The number itself, since everything divides 0. The GCF of 0 and 0 is undefined, so the tool reports it as an error. Negative numbers are treated by their size.
Are my numbers saved or sent?
No. The GCF is worked out in your browser. What you type is not put in the address bar, not stored and not counted. We only count whether you entered two numbers or more.
More from FLXCode
LCM CalculatorNew
Least common multiple of two or more numbers, with the prime factor method, the GCF formula and a list of multiples.
Prime Factorization CalculatorNew
Break a number into primes, in exponent form, with a factor tree drawing. Works up to 1e15.
Factor CalculatorNew
All factors and factor pairs of a number, and whether it is prime. Works up to 1e15.
Long Division CalculatorNew
Long division laid out like on paper, with the remainder and the decimal, repeating part marked.