LCM and HCF Calculator
The LCM and HCF calculator finds the Lowest Common Multiple and Highest Common Factor of up to five numbers at once, then shows the prime factorization of each number so you understand exactly how the answer was reached. LCM is essential for adding fractions with different denominators and finding common time cycles. HCF is used for simplifying fractions and dividing things into equal groups.
Factor Tree Visual
How to Use
- Enter two numbers to begin. Use the add button when you need three, four, or five numbers.
- Use positive whole numbers. LCM and HCF are defined for integers, so decimals should be converted before using the calculator.
- Click Calculate LCM and HCF. The top result cards show both values immediately.
- Review the prime factorization table. It shows exactly how every entered number breaks down into prime factors.
- Use HCF when dividing into equal groups and LCM when finding common cycles, shared denominators, or repeated schedules.
LCM and HCF Formulas
LCM(a, b) = |a × b| / HCF(a, b)
HCF, also called GCD, is the greatest whole number that divides every input exactly. It is found efficiently using the Euclidean algorithm: divide the larger number by the smaller, keep the remainder, then repeat until the remainder is zero. The last nonzero divisor is the HCF. LCM is the smallest positive number that every input divides into exactly. For two numbers, LCM can be calculated from HCF using |a × b| divided by HCF(a, b). For more than two numbers, apply the same idea repeatedly: find the LCM of the first two, then find the LCM of that result with the next number. Prime factorization explains why this works. HCF keeps only the shared prime factors at their lowest powers, while LCM includes every prime factor needed at its highest power.
Worked Example
Find LCM and HCF of 12 and 18. Prime factorize both numbers: 12 = 2 × 2 × 3, and 18 = 2 × 3 × 3. The common prime factors are 2 and 3, so HCF = 2 × 3 = 6. For LCM, include every prime factor at the highest power found in either number: 2² appears in 12 and 3² appears in 18. Therefore LCM = 2 × 2 × 3 × 3 = 36. Check: 36 is divisible by both 12 and 18, and no smaller positive number is divisible by both. The fraction 12/18 also simplifies by dividing by HCF 6, giving 2/3.
Choosing LCM or HCF
Use HCF when the problem asks for the largest equal group size, largest equal length, or simplest shared divisor. If 36 chocolates and 48 biscuits must be packed into identical boxes with no leftovers, HCF tells the largest number of boxes possible. Use LCM when the problem asks when cycles meet again, when denominators need a common base, or when repeated events happen together. If one bell rings every 12 minutes and another every 18 minutes, LCM tells when they next ring at the same time. In short, HCF divides quantities into equal parts, while LCM brings separate repeating patterns to a common multiple. A quick clue is the wording: “largest possible equal” usually points to HCF, while “next time together” usually points to LCM.
Common LCM and HCF Pairs
| Numbers | LCM | HCF | Use case |
|---|---|---|---|
| 4, 6 | 12 | 2 | Fraction: 1/4 + 1/6 |
| 12, 18 | 36 | 6 | Simplify 12/18 |
| 7, 11 | 77 | 1 | Coprime numbers |
| 24, 36 | 72 | 12 | Tile problem |
| 15, 25 | 75 | 5 | Event scheduling |
| 100, 75 | 300 | 25 | Equal distribution |
| 8, 12, 16 | 48 | 4 | Three numbers |
| 6, 10, 15 | 30 | 1 | Three numbers |
LCM and HCF FAQ
What is HCF
HCF means Highest Common Factor. It is the largest whole number that divides two or more numbers without leaving a remainder. For example, the factors of 12 include 1, 2, 3, 4, 6, and 12. The factors of 18 include 1, 2, 3, 6, 9, and 18. Their highest common factor is 6. HCF is useful for simplifying fractions, sharing items equally, cutting materials into equal lengths, and identifying the largest common group size.
What is LCM
LCM means Lowest Common Multiple. It is the smallest positive number that is a multiple of all given numbers. For example, multiples of 4 are 4, 8, 12, 16, and so on. Multiples of 6 are 6, 12, 18, and so on. The first shared multiple is 12, so LCM(4, 6) is 12. LCM is used for common denominators, repeated schedules, blinking lights, traffic cycles, and problems where events repeat at different intervals.
How are LCM and HCF related
For two positive numbers, the product of the numbers equals the product of their LCM and HCF. In formula form, a × b = LCM(a, b) × HCF(a, b). This relationship gives the useful formula LCM(a, b) = |a × b| / HCF(a, b). For example, 12 × 18 = 216, and their HCF is 6. So LCM = 216 ÷ 6 = 36. This connection works because HCF contains shared prime factors and LCM contains all needed prime factors.
What does coprime mean
Two numbers are coprime when their HCF is 1. This means they share no common factor other than 1. For example, 7 and 11 are coprime because both are prime and different. The LCM of coprime numbers is simply their product, so LCM(7, 11) = 77. Coprime numbers are important in fraction simplification, modular arithmetic, cryptography, and repeating cycles. A pair does not need both numbers to be prime to be coprime; 8 and 15 are also coprime.
Can I find LCM and HCF for more than two numbers
Yes. For HCF, find the HCF of the first two numbers, then find the HCF of that result and the next number. Continue until all numbers are included. For LCM, do the same with the LCM formula: find the LCM of the first two numbers, then combine that result with the next number. This calculator follows that iterative method for up to five numbers. The prime factorization output helps confirm which common factors and required multiples create the final answer.