About the GCF and LCM Calculator
GCF and LCM Calculator finds the greatest common factor and the least common multiple of two to ten whole numbers. Type the numbers separated by commas, spaces or new lines, and both answers appear immediately as exact integers, even for numbers of up to 15 digits. Open Show the work to see the prime factorisation of each number, and the Euclidean algorithm steps when you enter two numbers, or the pair-by-pair reduction for three or more. The tool accepts whole numbers greater than 0 only, with no decimals and no negatives. GCF is also called GCD or HCF. The LCM is the smallest number that every input divides evenly.
Updated October 2026
How to use the GCF and LCM Calculator
- 1Type or paste two to ten whole numbers, separated by commas, spaces or new lines.
- 2Read the greatest common factor and the least common multiple.
- 3Tap Copy under either answer to copy it.
- 4Open Show the work to see prime factors and the steps.
- 5Press Reset to go back to the example.
GCF and LCM in plain words
The GCF answers the question: what is the biggest number that fits evenly into all of these? It is used to shorten fractions and to split things into equal groups without leftovers. The LCM answers a different question: what is the first number that all of these divide into? It is used to find common denominators and to find when repeating events line up.
For any two numbers, GCF × LCM equals the product of the numbers. The calculator uses that relation for the LCM, with big integers so that results above 9 quadrillion stay exact.
Method 1: prime factors
Break each number into primes: 360 is 2³ × 3² × 5, and 84 is 2² × 3 × 7. The GCF takes each prime at its lowest power that appears in every number, here 2² × 3 = 12. The LCM takes each prime at its highest power in any number, here 2³ × 3² × 5 × 7 = 2,520.
Show the work lists these factorisations for each of your numbers. For 15-digit numbers the search can take a moment, so it starts after you stop typing.
Method 2: the Euclidean algorithm
Divide the larger number by the smaller and keep the remainder. Then divide the smaller number by that remainder, and repeat until the remainder is 0. The last non-zero remainder is the GCF. For 48 and 18: 48 = 2 × 18 + 12, 18 = 1 × 12 + 6, 12 = 2 × 6 + 0, so the GCF is 6.
This method needs no factoring, so it is quick even for huge numbers. With more than two inputs the tool applies it to one pair at a time. When you are adding up marks or prices after simplifying, use the Average Calculator for the mean, and the Percentage Calculator for shares.
Using GCF and LCM with fractions
- Divide the top and bottom of a fraction by their GCF to write it in lowest terms.
- Use the LCM of the denominators as the common denominator when adding fractions.
- Fraction Calculator does these steps for you when you have a whole sum to solve.
- For scheduling, the LCM of the cycle lengths gives the day they coincide again.
- To look at the primes on their own, use Prime Number Calculator.
Features
- GCF (GCD, HCF) and LCM together
- Two to ten numbers at once
- Exact answers for up to 15-digit numbers
- Prime factorisation of each number
- Euclidean algorithm steps for two numbers
- Copy either answer
- Runs in your browser
Frequently asked questions
What is the greatest common factor?
It is the largest whole number that divides every number in the list without a remainder. For 12 and 18 the common factors are 1, 2, 3 and 6, so the greatest is 6. It is also called the greatest common divisor, or GCD.
How do I find the LCM of two numbers?
Multiply the two numbers and divide by their GCF. For 4 and 6 the GCF is 2, so the LCM is 24 divided by 2, which is 12. You can also list multiples of each number until they first meet.
What is the difference between GCF and HCF?
There is none. Highest common factor, greatest common factor and greatest common divisor are three names for the same number. HCF is common in the UK and India, and GCF and GCD in the United States.
How do I find GCF of three numbers?
Find the GCF of the first two, then the GCF of that answer and the third number. For 12, 18 and 24, GCF(12, 18) is 6 and GCF(6, 24) is 6. Open Show the work to see this shown for your numbers.
How do you find the LCM using prime factors?
Write each number as a product of primes, then take each prime at its highest power found in any number, and multiply. For 12 = 2² × 3 and 18 = 2 × 3², the LCM is 2² × 3² = 36.
What is the LCM of 4 and 6?
It is 12. Multiples of 4 are 4, 8, 12 and multiples of 6 are 6, 12, and 12 is the first one they share. Enter 4 and 6 above to check it.