LCM and HCF Calculator (Lowest Common Multiple & Highest Common Factor)
Calculate the LCM and HCF of any two or three numbers with full prime factorisation working shown. Essential for fractions, algebra, and number theory.
LCM and HCF Guide
Finding HCF by Prime Factorisation
The Highest Common Factor (HCF) is the largest number that divides exactly into all the given numbers. Method: find the prime factorisation of each number, identify the common prime factors, multiply common primes taking the lowest power. Example: HCF(12, 18). 12 = 2² × 3. 18 = 2 × 3². Common primes: 2 (lowest power: 2¹) and 3 (lowest power: 3¹). HCF = 2 × 3 = 6. Alternative: Euclidean algorithm. HCF(18, 12): 18 = 1 × 12 + 6. 12 = 2 × 6 + 0. HCF = 6.
Finding LCM by Prime Factorisation
The Lowest Common Multiple (LCM) is the smallest number that all given numbers divide into exactly. Method: find prime factorisation of each, take each prime at its highest power appearing in any factorisation. Example: LCM(12, 18). 12 = 2² × 3. 18 = 2 × 3². LCM = 2² × 3² = 4 × 9 = 36. Check: 36/12 = 3 ✓. 36/18 = 2 ✓. Key relationship: LCM(a, b) × HCF(a, b) = a × b. For 12 and 18: LCM × HCF = 36 × 6 = 216 = 12 × 18 ✓.
Applications of LCM and HCF
Adding fractions: use LCM as the common denominator. 1/12 + 1/18: LCM = 36, so 3/36 + 2/36 = 5/36. Simplifying fractions: divide numerator and denominator by HCF. 12/18: HCF = 6, so 12/18 = (12÷6)/(18÷6) = 2/3. Tiling problems: a floor 12m × 18m needs square tiles of the largest possible size → tile side = HCF(12,18) = 6m. Traffic light timing: two sets of lights change every 12s and 18s → they synchronise every LCM(12,18) = 36 seconds. Gear ratios: teeth counts on meshing gears use LCM to find
Prime Factorisation Method
To find prime factors: divide by 2 until no longer divisible. Then divide by 3, then 5, then 7, and successive primes. Write as a product of prime powers. 360 = 2 × 180 = 2 × 2 × 90 = 2 × 2 × 2 × 45 = 2 × 2 × 2 × 3 × 15 = 2 × 2 × 2 × 3 × 3 × 5 = 2³ × 3² × 5. A number is prime if it has no factors other than 1 and itself — to test, only check divisibility by primes up to √n (since any factor above √n would pair with one below √n). 97 is prime: check up to √97 ≈ 9.8 — not divisible by 2, 3, 5, 7.
Recommended for this calculator