What Is LCM and HCF in Maths?
LCM and HCF compare whole numbers in opposite ways: HCF finds the greatest factor shared by all the numbers, while LCM finds their smallest shared positive multiple.
Written and checked by TheToolNet Editorial Team · Last reviewed: August 22, 2026 · How we check maths guides
HCF means highest common factor: the greatest positive whole number that divides every input exactly. LCM means least common multiple: the smallest positive whole number divisible by every input.
Example: for 12 and 18, HCF = 6 and LCM = 36.
Check numbers with the GCD and LCM calculator
Factors and multiples come first
A factor divides a number without a remainder. The factors of 12 are 1, 2, 3, 4, 6 and 12. A multiple is produced by multiplying a number by a whole number. The positive multiples of 12 begin 12, 24, 36, 48 and 60.
HCF searches downward among shared factors. LCM searches upward among shared multiples. Remembering that direction is more reliable than memorizing isolated keywords.
Difference between LCM and HCF
| Question | HCF | LCM |
|---|---|---|
| Full form | Highest common factor | Least common multiple |
| What it finds | Greatest number dividing all inputs | Smallest positive number divisible by all inputs |
| Other names | GCD or GCF | Lowest common multiple |
| Typical direction | Split into the largest equal groups | Combine repeating cycles at their first meeting |
| For 12 and 18 | 6 | 36 |
How to find LCM and HCF of numbers
List factors or multiples
For small numbers, list every factor to find the largest common one, or list multiples until the first shared value appears. This method makes the definitions visible but becomes slow for large inputs.
Use prime factorization
Write each number as a product of primes. For HCF, use only shared primes at their lowest exponents. For LCM, use every prime that occurs at its highest exponent.
For 12 = 2² × 3 and 18 = 2 × 3², the HCF is 2 × 3 = 6. The LCM is 2² × 3² = 36.
Use division for the HCF
Divide the larger number by the smaller, then repeat with the previous divisor and remainder. The last non-zero remainder is the HCF. For two non-zero numbers, use the relationship with their product to obtain the LCM.
When to use LCM and when to use HCF
| Situation | Choose | Reason |
|---|---|---|
| Cut several lengths into the largest identical pieces | HCF | The piece size must divide every length. |
| Make the greatest number of identical packs | HCF | The number of packs must divide every quantity. |
| Find when repeating lights or schedules next coincide | LCM | The answer must be a shared multiple of each cycle. |
| Find the least common denominator | LCM | The denominator must be divisible by all original denominators. |
“Largest” and “together” can be clues, but they are not complete rules. Ask whether the unknown must divide every quantity (HCF) or be divisible by every quantity (LCM).
HCF and LCM of 2, 3 and 4
The prime forms are 2, 3 and 2². No prime is shared by all three numbers, so their HCF is 1. Taking each prime at its greatest required exponent gives 2² × 3 = 12, so their LCM is 12.
Check: 1 divides 2, 3 and 4; 12 is divisible by 2, 3 and 4.
LCM and HCF formula for two numbers
HCF(a,b) × LCM(a,b) = |a × b|
For positive numbers, LCM(a,b) = a × b ÷ HCF(a,b). Divide before multiplying when calculating with large values. This simple product identity is for two numbers; do not apply it unchanged to three or more inputs.
Common mistakes
- Choosing HCF because a problem says “largest” even though the required answer must be a multiple.
- Using the lowest prime exponent for LCM instead of the highest.
- Calling 0 the LCM. Standard elementary definitions use the smallest positive common multiple.
- Assuming HCF and LCM identify a unique pair of numbers without checking whether several factor pairs are possible.
Frequently asked questions
What is LCM and HCF in maths?
HCF is the greatest positive factor common to all inputs. LCM is the smallest positive multiple common to all inputs.
Are GCD and HCF the same?
Yes. Greatest common divisor, greatest common factor and highest common factor name the same value.
When should I use HCF instead of LCM?
Use HCF when the answer must divide all quantities, such as the largest equal group or piece. Use LCM when the answer must be divisible by all quantities, such as the first meeting of repeating cycles.
What are the HCF and LCM of 2, 3 and 4?
The HCF is 1 and the LCM is 12.
Calculate or continue learning
Use the GCD and LCM calculator for 2–8 numbers with prime factors, Euclidean steps and verification. Programmers can see a safe implementation in the LCM and HCF in C guide.