How to use the LCM & GCF Calculator
- Enter two or more whole numbers.
- Read the GCF and LCM.
- Check the prime factorization of each number in the working.
What does this tool do?
The greatest common factor (also called GCD or HCF) is the biggest number that divides all of your numbers exactly. The least common multiple is the smallest number they all divide into.
You use the GCF to simplify fractions and the LCM to find a common denominator when adding fractions.
Why use it?
- Works with any number of values, not just two.
- Shows prime factorizations.
- Uses exact integer arithmetic.
Example: 12, 18 and 30
12 = 2² × 3, 18 = 2 × 3², 30 = 2 × 3 × 5. The GCF takes the lowest shared powers: 2 × 3 = 6. The LCM takes the highest powers of every prime: 2² × 3² × 5 = 180.
The formula
Privacy
The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved. There's no account to create and nothing to install.
Frequently asked questions
What's the quickest way to find the LCM of two numbers?
Multiply them and divide by their greatest common factor. For 12 and 18, the GCF is 6, so the LCM is 12 × 18 ÷ 6 = 36.
Are GCF, GCD and HCF the same thing?
Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number. Which one you see depends mostly on the country and textbook.
Last reviewed by the M2Toolkit team.