LCM and HCF Calculator
How do you calculate LCM and HCF?
Method 1: Prime factorisation
Find LCM(12, 18): 12 = 2² × 3. 18 = 2 × 3². LCM = take highest power of each prime = 2² × 3² = 36. HCF = take lowest power of each prime = 2¹ × 3¹ = 6. Pairs well with the Fraction Calculator and the Exponent Calculator.
Method 2: Euclidean algorithm (for HCF)
HCF(48, 18): 48 = 2 × 18 + 12. 18 = 1 × 12 + 6. 12 = 2 × 6 + 0. HCF = 6 (the last non-zero remainder). This is the fastest algorithm for large numbers.
Relationship between LCM and HCF
For any two numbers a and b: LCM(a,b) × HCF(a,b) = a × b. Example: LCM(12,18) = 36, HCF(12,18) = 6. 36 × 6 = 216 = 12 × 18 ✓
LCM reference table for common numbers
| Numbers | HCF | LCM | Application |
|---|---|---|---|
| 2 and 3 | 1 | 6 | Adding 1/2 + 1/3 = LCD 6 |
| 4 and 6 | 2 | 12 | Adding 1/4 + 1/6 = LCD 12 |
| 3, 4, and 6 | 1 | 12 | Scheduling: 3, 4, 6-day cycles sync at 12 days |
| 12 and 18 | 6 | 36 | Gear teeth ratio |
| 100 and 75 | 25 | 300 | Dividing quantities into equal groups |
Where are LCM and HCF used in real life?
LCM applications: Adding and subtracting fractions (finding LCD), scheduling recurring events (bus schedules, factory maintenance cycles), musical rhythm patterns.
HCF applications: Dividing items into equal groups without remainder, simplifying fractions, tiling problems (largest square tile for a given room), ratio simplification.
Frequently asked questions
What is LCM with an example?
LCM (Lowest Common Multiple) is the smallest positive integer divisible by all the given numbers. LCM(4, 6) = 12 because 12 is the smallest number that both 4 and 6 divide into evenly. LCM is used when adding fractions: 1/4 + 1/6 requires LCD 12.
What is HCF (Highest Common Factor)?
HCF (also called GCD — Greatest Common Divisor) is the largest number that divides all given numbers exactly with no remainder. HCF(12, 18) = 6 because 6 is the largest number that divides both 12 and 18 evenly. HCF is used to simplify fractions: 12/18 ÷ 6/6 = 2/3.
How do you find LCM for 3 or more numbers?
Find LCM of the first two numbers, then find LCM of that result with the third number. LCM(2, 3, 4): LCM(2,3)=6, then LCM(6,4)=12. Alternatively: prime factorise all numbers, then take the highest power of each prime that appears.
What is the LCM of 0 and any number?
LCM(0, n) = 0 for any non-zero integer n, by convention. The LCM of zero and any number is zero because every multiple of 0 is 0, and the common multiple of any number and 0 is 0.
How is LCM used in adding fractions?
To add 1/4 + 1/6, find LCM(4,6) = 12. Convert: 3/12 + 2/12 = 5/12. The LCM of the denominators is the Lowest Common Denominator (LCD). Using LCD gives the simplest equivalent fractions before adding.
Sources & References
Sources: Euclid, Elements Book VII (Euclidean algorithm); NIST Digital Library of Mathematical Functions; Common Core State Standards CCSS.MATH.CONTENT.6.NS.B.4.
Exam-style LCM and HCF word problems
LCM and HCF appear in many exam questions that describe real-world scenarios. Recognise the type of problem by its wording:
| Problem Type | Use | Example |
|---|---|---|
| "When will they meet again?" / "When do events coincide?" | LCM | Buses every 12 and 18 min → LCM(12,18)=36 min |
| "Largest equal groups with no remainder" | HCF | 42 apples and 56 oranges → HCF(42,56)=14 groups of 3 apples and 4 oranges |
| "Largest square tile to cover a floor exactly" | HCF | Room 480cm × 360cm → HCF(480,360)=120cm tiles |
| "Smallest piece of rope to measure two lengths exactly" | HCF | Ropes 36m and 48m → HCF(36,48)=12m |
| "Shortest time for lights flashing at different intervals to flash together" | LCM | Lights at 4s and 6s → LCM(4,6)=12s |
| "Adding fractions with different denominators" | LCM (as LCD) | 1/4 + 1/6 → LCM(4,6)=12 → 3/12+2/12=5/12 |
Euclidean algorithm — fastest method for large numbers
The Euclidean algorithm finds HCF without prime factorisation. Divide the larger by the smaller; take the remainder; repeat until remainder is 0. The last non-zero remainder is the HCF.
Example: HCF(252, 105)
252 = 2 × 105 + 42
105 = 2 × 42 + 21
42 = 2 × 21 + 0 ← remainder is 0
HCF = 21. Verify: 252÷21=12 ✓, 105÷21=5 ✓
Then use the relationship: LCM(252, 105) = (252 × 105) ÷ 21 = 26,460 ÷ 21 = 1,260.
HCF for simplifying fractions and ratios
The HCF is used to reduce fractions to lowest terms. 48/60: HCF(48,60) = 12. 48÷12=4, 60÷12=5. Result: 4/5. Ratio 56:84: HCF(56,84)=28. 56÷28=2, 84÷28=3. Result: 2:3. Co-prime numbers have HCF=1 (e.g. 8 and 9) — they cannot be simplified further. Any two consecutive integers are always co-prime.
LCM of fractions and algebraic expressions
LCM of fractions: LCM(a/b, c/d) = LCM(a,c) ÷ HCF(b,d). Example: LCM(2/3, 3/4) = LCM(2,3) ÷ HCF(3,4) = 6 ÷ 1 = 6. Verify: 6 ÷ (2/3) = 9 ✓, 6 ÷ (3/4) = 8 ✓ — both are integers. HCF of fractions: HCF(a/b, c/d) = HCF(a,c) ÷ LCM(b,d). Example: HCF(2/3, 3/4) = HCF(2,3) ÷ LCM(3,4) = 1 ÷ 12 = 1/12. These formulas are used in simplifying algebraic fractions and finding common terms in polynomial expressions.
Prime factorisation for three numbers: step-by-step
Find LCM and HCF of 12, 18, and 30. Step 1 — factorise: 12 = 2² × 3. 18 = 2 × 3². 30 = 2 × 3 × 5. Step 2 — LCM: take highest power of each prime: 2² × 3² × 5 = 4 × 9 × 5 = 180. Step 3 — HCF: take lowest power of each prime that appears in ALL: 2¹ × 3¹ = 6. Verify: 180÷12=15 ✓, 180÷18=10 ✓, 180÷30=6 ✓. And 6 divides 12 ✓, 18 ✓, 30 ✓. Related: Fraction Calculator.
LCM and HCF word problems: tiles, buses, and lights
LCM and HCF appear in a specific set of standard exam word problems. Recognising the problem type determines which to use:
- Use HCF when: cutting into equal pieces, dividing into equal groups, finding the largest tile that fits without cutting. ("Largest" or "maximum" → HCF)
- Use LCM when: finding when things coincide again, minimum quantity, smallest common measure. ("First time again" or "minimum" → LCM)
| Problem Type | Use | Example |
|---|---|---|
| Tiles fitting a floor | HCF of room dimensions | Room 12m × 8m: HCF(12,8) = 4m → 4m × 4m tiles, 6 tiles needed |
| Buses/trains meeting at start | LCM of intervals | Buses every 12 min and 18 min: LCM(12,18) = 36 min → meet every 36 min |
| Lights flashing together | LCM of flash intervals | Flash every 4s and 6s: LCM(4,6) = 12s → flash together every 12 seconds |
| Distributing items equally | HCF of item counts | 56 apples and 42 oranges: HCF(56,42) = 14 → 14 equal bags |
| Minimum length of rope | LCM of piece lengths | Pieces of 2.5m and 1.5m: LCM(5,3)÷2 = 7.5m minimum |
Euclidean algorithm: HCF by long division
The Euclidean algorithm finds HCF without prime factorisation — faster for large numbers. Divide the larger number by the smaller; the remainder becomes the new divisor. Repeat until remainder = 0. The last non-zero remainder is the HCF.
Example: HCF(252, 105)
- 252 ÷ 105 = 2 remainder 42
- 105 ÷ 42 = 2 remainder 21
- 42 ÷ 21 = 2 remainder 0
- HCF = 21 ✓
Verify: LCM(252, 105) = (252 × 105) ÷ 21 = 26,460 ÷ 21 = 1,260. Check: 1,260 ÷ 252 = 5 ✓; 1,260 ÷ 105 = 12 ✓.
LCM of fractions and co-prime numbers
LCM of fractions: LCM = LCM of numerators ÷ HCF of denominators. HCF of fractions = HCF of numerators ÷ LCM of denominators. Example: LCM(½, ⅔, ¾) = LCM(1,2,3) ÷ HCF(2,3,4) = 6 ÷ 1 = 6.
Co-prime numbers: Two numbers are co-prime (relatively prime) when their HCF = 1. Co-prime pairs: (8, 9), (15, 17), (25, 36). For co-prime numbers, LCM = their product. LCM(8, 9) = 72 = 8 × 9. This is useful in modular arithmetic and RSA encryption, where large co-prime numbers provide security.