01 / GCF
The biggest shared factor
The largest whole number that divides every number in the list with nothing left over.
Free tool
Type two to ten whole numbers to get their greatest common factor (also called GCD or HCF) and their least common multiple, both at once. Pick how you want to see the working: prime factorisation, the Euclidean algorithm, listing factors and multiples, or the ladder method taught in many classrooms. Numbers can be very large, and with two numbers the page also puts a fraction into its lowest terms.
Separate numbers with spaces, commas or new lines. Whole numbers only. A minus sign is ignored.
Worked out in your browser. Nothing is sent anywhere.
The maths
01 / GCF
The largest whole number that divides every number in the list with nothing left over.
02 / LCM
The smallest number that every number in the list divides into with nothing left over.
03 / Link
For two numbers, GCF × LCM = the first number × the second number.
Guide
A GCF calculator finds the greatest common factor of a set of numbers: the biggest whole number that divides all of them exactly. An LCM calculator finds the least common multiple: the smallest number that all of them divide into exactly. This page works out both for up to ten numbers at once and shows the working four ways, so you can match the method your class or textbook uses. Big numbers are fine, because the page uses exact whole-number arithmetic with no rounding.
Split each number into primes. 12 = 2² × 3 and 18 = 2 × 3². For the GCF, keep the primes both numbers share, each to its lowest power: 2 and 3, so 2 × 3 = 6. For the LCM, keep every prime that appears, each to its highest power: 2² and 3², so 4 × 9 = 36. The page lays the primes out in a table with the lowest and the highest power of each, so you can see where the answers come from.
This method needs no factoring, so it works for huge numbers. Divide the bigger number by the smaller and keep the remainder. Repeat with the smaller number and the remainder until the remainder is 0. The last non-zero remainder is the GCF. For 48 and 18: 48 = 2 × 18 + 12, then 18 = 1 × 12 + 6, then 12 = 2 × 6 + 0. The GCF is 6. For two numbers, LCM = a × b ÷ GCF, so the LCM of 48 and 18 is 48 × 18 ÷ 6 = 144. For more numbers the page works through them one at a time.
List all the factors of each number and pick the biggest one in every list. The factors of 12 are 1, 2, 3, 4, 6 and 12. The factors of 18 are 1, 2, 3, 6, 9 and 18. The shared ones are 1, 2, 3 and 6, so the GCF is 6. For the LCM, list multiples instead. Multiples of 4 are 4, 8, 12 and multiples of 6 are 6, 12, so the LCM of 4 and 6 is 12. Listing is easy to follow but gets long, so the page only does it for numbers up to 1,000,000.
Write the numbers in a row. Find a prime that divides at least two of them, write it on the left, and divide. Numbers the prime does not divide are brought down. Keep going until no prime divides two numbers in the bottom row. For 12, 18 and 30: divide by 2 to get 6, 9, 15, then by 3 to get 2, 3, 5. No prime divides two of those. The GCF is the product of the primes that divided every number: 2 × 3 = 6. The LCM is all the primes on the left times the bottom row: 2 × 3 × 2 × 3 × 5 = 180.
| Task | Use | Example |
|---|---|---|
| Simplify a fraction | GCF | 18/24: the GCF is 6, so it is 3/4 |
| Add fractions with different bottoms | LCM | 1/12 + 1/18: the LCM is 36, so 3/36 + 2/36 = 5/36 |
| Split into equal groups | GCF | 24 and 36 items fit into 12 equal groups |
| Find when two cycles meet | LCM | Buses every 12 and 18 minutes meet again after 36 minutes |
For the factors and prime factorisation of one number, use the factor calculator. To simplify and add fractions with the working shown, use the fraction calculator, and for the remainder of a division, the remainder calculator.
Questions
Nothing. They are three names for the same number: the greatest common factor, greatest common divisor and highest common factor.
Find the GCF of the first two, then the GCF of that answer and the next number, and so on. The calculator does this for up to ten numbers.
Divide their product by their GCF. For 12 and 18, 12 × 18 = 216, and 216 ÷ 6 = 36.
It is 1, because two different primes share no factor but 1. Their LCM is their product.
Divide the top and the bottom by their GCF. 18/24 has a GCF of 6, so it becomes 3/4. Type the two numbers and read the lowest terms card.
No. The GCF can be as big as the smallest number but never bigger. The LCM is at least as big as the largest number.
No, only whole numbers. For a decimal, scale it to a whole number first, for example by working with 25 and 150 instead of 0.25 and 1.5.
Up to 150 digits each. The page uses exact whole-number arithmetic, so there is no rounding at any size.
No. Everything is worked out in your browser.