How to Find LCM and HCF
The highest common factor (HCF), also called the greatest common divisor (GCD), is the biggest number that divides every number in your set exactly, with nothing left over. The least common multiple (LCM) runs in the opposite direction: it is the smallest number that every number in your set divides into exactly. One looks downward for a shared divisor, the other upward for a shared multiple, and together they quietly power fraction arithmetic, scheduling, and fair sharing. This calculator finds both for two or more whole numbers at once, and — just as usefully — shows the Euclidean algorithm steps and a full prime factorization of every number, so the method is visible rather than magic.
The Definitions, Symbol by Symbol
In the notation HCF(a, b) and LCM(a, b), the letters a and b simply stand for any two whole numbers in your set. Their prime factorizations are written with powers such as 2³, where the base is a prime number and the exponent counts how many times that prime appears as a factor. The HCF is built by taking, for each prime appearing in both numbers, the lowest of the two powers; the LCM is built by taking, for each prime appearing in either number, the highest power. For exactly two numbers the two answers are linked by the identity LCM(a, b) × HCF(a, b) = a × b — so each answer can be checked against the other, and if you know one, the other is a single division away.
Two Reliable Methods
- Prime factorization: break each number into primes; the HCF takes the lowest power of each shared prime, the LCM takes the highest power of every prime present.
- Euclidean algorithm: repeatedly replace the larger number with the remainder of dividing it by the smaller — the fastest route to the HCF, shown step by step above.
How to Use This Calculator
- Type your numbers into the single input field, separated by commas or spaces — the field starts with 12, 18, 24, and you can enter as few as two numbers or as many as you like.
- Watch the result panel, which updates as you type: your LCM appears on the left in green and your HCF (GCD) on the right, both in large type.
- Read the Euclidean steps listed under the results, which show the algorithm working on your first pair of numbers, followed by the line that derives the LCM from your numbers and their HCF.
- Scroll to the Prime Factorization panel to see each of your first six numbers broken into primes with every division step — the working you would show in an exam.
Worked Example 1: LCM and HCF of 12 and 18
- Factor both numbers: 12 = 2² × 3 and 18 = 2 × 3².
- HCF: take the lowest power of each shared prime: 2¹ × 3¹ = 6.
- LCM: take the highest power of every prime present: 2² × 3² = 36.
- Identity check: LCM × HCF = 36 × 6 = 216, and 12 × 18 = 216. ✓
Cross-check the HCF by Euclid's method, as the calculator displays: 18 = 12 × 1 + 6, then 12 = 6 × 2 + 0, so the last non-zero remainder is 6 — the same HCF the factorization gave. Two independent methods agreeing is what a correct answer looks like.
Worked Example 2: LCM and HCF of 24 and 36
Factor each number down to primes. 24 = 2 × 2 × 2 × 3 = 2³ × 3. 36 = 2 × 2 × 3 × 3 = 2² × 3². For the HCF, take the lower power of each shared prime: 2² (the smaller of 2³ and 2²) and 3¹ (the smaller of 3¹ and 3²), giving 2² × 3 = 4 × 3 = 12. For the LCM, take the higher power of each prime: 2³ and 3², giving 8 × 9 = 72. Now run the identity check: LCM × HCF = 72 × 12 = 864, and the original numbers multiply to 24 × 36 = 864 — the two sides match, so both answers are consistent. Euclid confirms the HCF independently: 36 = 24 × 1 + 12, then 24 = 12 × 2 + 0, ending at 12.
Where They Show Up
Adding fractions with unlike denominators needs the LCM: sixths and eighths only combine once both are rewritten over the LCM 24. Simplifying a fraction needs the HCF of numerator and denominator — 24/36 collapses to 2/3 precisely because their HCF is 12, as the example above shows. Scheduling problems are LCM problems in disguise: buses leaving every 12 and every 18 minutes depart together every 36 minutes. Sharing and tiling run on the HCF: the largest equal groups with nothing left over, or the biggest square tile that fits a floor exactly, are both HCF answers.
Three Mistakes to Watch For
First, swapping the power rules: taking the highest powers for the HCF or the lowest for the LCM produces each other's answer — remember the HCF is the smaller result and can never exceed the smallest number you entered. Second, applying the identity LCM × HCF = a × b to three or more numbers: it is a two-number theorem, and for three numbers the calculator's pairwise method is the correct route. Third, stopping a factorization too early — writing 24 = 4 × 6 and treating 4 and 6 as if they were primes, or listing 1 among the prime factors. Every branch of the factor tree must end in a prime.
Simplifying a fraction with these results? Try our fraction calculator or the four-function calculator. Working under the American name for the same number? Our GCF calculator finds the greatest common factor — identical to the HCF — with the full list of common factors.