GCF & LCM Calculator
This GCF and LCM calculator finds the greatest common factor and the least common multiple of any set of numbers at once. Type two or more whole numbers and you'll get both answers, the prime factors of each number, and a step-by-step breakdown that shows exactly which factors they share. It's the same method your teacher wants, done instantly.
- GCF (HCF / GCD)
- LCM
- Two or more numbers
- Prime factors shown
- Steps shown
Last updated June 16, 2026 GCF, HCF, and GCD are the same thing Reviewed by the Calcowa math team
Separate with commas or spaces. Use two or more whole numbers above 0.
Enter at least two whole numbers above 0.
What is the greatest common factor?
The greatest common factor is the largest whole number that divides evenly into every number in your set. It's also called the highest common factor (HCF) or the greatest common divisor (GCD), and all three names mean the same value. The GCF is handy for simplifying fractions and splitting things into equal groups, because it's the biggest piece you can break every number into without a remainder. That's why it shows up so often in everyday math.
How do you find the GCF and LCM?
The prime-factor method gives you both answers from the same work, so you won't repeat yourself. Here's how it goes for 12 and 18, the same steps the calculator runs:
- 1
Prime factorize each numberBreak each one into primes: 12 is 2 × 2 × 3, and 18 is 2 × 3 × 3.
- 2
For the GCF, take shared primes at the lowest powerBoth share one 2 and one 3, so the GCF is 2 × 3 = 6.
- 3
For the LCM, take every prime at the highest powerUse 2² from 12 and 3² from 18, so the LCM is 4 × 9 = 36.
- 4
Check itFor two numbers, GCF × LCM should equal their product: 6 × 36 = 216, and 12 × 18 = 216.
What is the least common multiple?
The least common multiple is the smallest number that every value in your set divides into evenly. Where the GCF looks at what the numbers share, the LCM looks at what's needed to cover all of them. It's what you reach for when you add fractions with different denominators, since the LCM of the denominators is the lowest common denominator. The calculator above gives you the LCM right beside the GCF, so you don't have to run two tools.
GCF, HCF, and GCD
If you've seen this idea called the highest common factor or the greatest common divisor, don't worry, they're identical. American textbooks lean on GCF, British ones on HCF, and computer science on GCD, but the number you compute is exactly the same. So a GCD calculator, an HCF calculator, and a GCF calculator all do this one job. This page reports a single value and labels it every way, so you're covered whichever term your class uses.
Using the GCF to simplify fractions
The most common use of the GCF is reducing a fraction to lowest terms: divide the top and bottom by their greatest common factor and the fraction is fully simplified in one move. For 12/18, the GCF is 6, so 12 ÷ 6 over 18 ÷ 6 gives 2/3, and you're done in a single division. Our simplify fractions calculator does that step for you, and the fraction calculator uses the LCM to add and subtract fractions across denominators.
Frequently asked questions
What is the GCF of two prime numbers?
If two numbers share no factors other than 1, their GCF is 1 and they're called coprime. Two different primes, like 5 and 7, are always coprime, so their GCF is 1 and their LCM is just their product, 35.
List the prime factors of each number, then multiply the primes they share, taking each shared prime to the lowest power it appears in. For 12 (2 × 2 × 3) and 18 (2 × 3 × 3), both share one 2 and one 3, so the GCF is 2 × 3 = 6. This GCF and LCM calculator runs that for you and shows every factor.
Take the prime factors of every number and multiply each distinct prime to the highest power it appears in any of them. For 12 (2² × 3) and 18 (2 × 3²) the highest powers are 2² and 3², so the LCM is 4 × 9 = 36. The least common multiple is the smallest number all of them divide into evenly.
The GCF is the largest number that divides into all of them, so it's never bigger than your smallest value. The LCM is the smallest number they all divide into, so it's never smaller than your largest value. GCF uses the shared primes at their lowest powers; LCM uses every prime at its highest power. They answer opposite questions.
Yes. The greatest common factor (GCF), highest common factor (HCF), and greatest common divisor (GCD) are three names for the exact same thing. Different textbooks and countries prefer different labels, but the number you get is identical, so this tool reports one value that covers all three.
For any two numbers, the GCF times the LCM equals the product of the two numbers. With 12 and 18 that's 6 × 36 = 216, which is also 12 × 18. So once you know one, you can find the other by dividing the product by it. The calculator shows this check whenever you enter exactly two numbers.
Yes. Type as many numbers as you like, separated by commas or spaces, and the calculator handles them all at once. The prime-factor method scales without any extra work: the GCF still multiplies the shared primes at their lowest powers, and the LCM multiplies every prime at its highest power across the whole list.
Related calculators
More tools that lean on factors and multiples.
Factor tree and exponent form.
Fraction calculatorAdd and subtract with the LCM.
All math calculatorsPercent, fractions, factors, more.
Factoring numbers?
Enter them above, or browse the full math hub.