GCF Calculator
The GCF calculator finds the greatest common factor, the largest whole number that divides every number in a list. For 12, 18 and 24 the GCF is 6, and the least common multiple is 72.
Sources: Wikipedia, OpenStax Prealgebra 2e Updated
Enter numbers separated by commas to find their Greatest Common Factor (GCF) and Least Common Multiple (LCM):
How to use the GCF calculator
- Enter two or more positive integers separated by commas
- Click "Calculate" to find both GCF and LCM
- GCF is the largest number that divides all input numbers evenly
- LCM is the smallest number that all input numbers divide into evenly
How to find the GCF with the Euclidean algorithm
The calculator uses the Euclidean algorithm and works through the list two numbers at a time. For 12, 18 and 24:
- Divide the larger of the first two by the smaller and keep the remainder: 18 = 1 × 12 + 6.
- Repeat with the smaller number and the remainder until the remainder is 0: 12 = 2 × 6 + 0, so GCF(12, 18) = 6.
- Bring in the next number the same way: 24 = 4 × 6 + 0, so GCF(6, 24) = 6 and GCF(12, 18, 24) = 6.
Each step only needs a remainder, which is what the modulus calculator works out.
Finding the GCF from prime factors
Another way, taught in OpenStax Prealgebra, is to split each number into primes, as the factor calculator does, and multiply the primes they all share. 12 = 2² × 3, 18 = 2 × 3² and 24 = 2³ × 3 share one 2 and one 3, so the GCF is 6.
How the LCM is worked out
For the least common multiple the tool uses LCM(a, b) = a × b ÷ GCF(a, b), again two numbers at a time. LCM(12, 18) = 216 ÷ 6 = 36, then LCM(36, 24) = 864 ÷ GCF(36, 24) = 864 ÷ 12 = 72.
Check: 72 ÷ 12 = 6, 72 ÷ 18 = 4 and 72 ÷ 24 = 3, all whole numbers. The LCM is the smallest common denominator when adding fractions, which the fraction calculator uses.
Why GCF × LCM equals the product of two numbers
For any two numbers, GCF × LCM = a × b. For 12 and 18: 6 × 36 = 216 = 12 × 18. That identity is how the calculator gets the LCM by dividing instead of listing multiples.
It holds for two numbers at a time, not for a whole list at once: 6 × 72 is not 12 × 18 × 24.
Where the GCF is used
The GCF reduces a fraction to lowest terms in one step and a ratio to its simplest form; the aspect ratio calculator turns 1920 × 1080 into 16:9 this way. It also gives the largest equal square tile that fits a rectangle exactly.
The tool needs at least two positive whole numbers. A single number, a decimal such as 4.5 or a negative value gives a message instead of a result. More number tools are on the arithmetic calculators page.
GCF Calculator: FAQ
Is the GCF the same as the GCD and the HCF?
Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number.
What is the GCF of two prime numbers?
1, unless they are the same prime. Numbers whose GCF is 1 are called coprime, like 8 and 15.
How does the GCF simplify a fraction?
Divide the top and the bottom by it. GCF(18, 24) = 6, so 18/24 = 3/4.
Sources
- Wikipedia: Euclidean algorithm — finding the greatest common divisor by repeated division (checked October 16, 2026)
- OpenStax Prealgebra 2e, 2.5 Prime Factorization and the Least Common Multiple — prime factorization and the least common multiple (checked October 16, 2026)