LCM & GCD Calculator
Find Least Common Multiple and Greatest Common Divisor
GCD / HCF
LCM

What is LCM and GCD (HCF)?

The GCD (Greatest Common Divisor), also called HCF (Highest Common Factor), is the largest number that divides all given numbers exactly. The LCM (Least Common Multiple) is the smallest number divisible by all given numbers. Both are fundamental in fractions, scheduling, and engineering.

Formula used

GCD — Euclidean algorithm: GCD(48,18): 48 = 2×18+12 → GCD(18,12): 18 = 1×12+6 → GCD(12,6) = 6 LCM formula: LCM(a,b) = |a × b| ÷ GCD(a,b) LCM(4,6) = 24 ÷ 2 = 12 Key identity: GCD(a,b) × LCM(a,b) = a × b

How to use this calculator

  1. Enter numbers separated by commas (e.g. 12, 18, 24)
  2. Click Calculate — GCD, LCM, and prime factorisation shown instantly

Example

Example 1 — Simplify a fraction:
48/72 → GCD(48,72) = 24 → 48÷24 / 72÷24 = 2/3

Example 2 — Add fractions 1/4 + 1/6:
LCM(4,6) = 12 → 3/12 + 2/12 = 5/12

Example 3 — Bus scheduling:
Bus A every 12 min, Bus B every 18 min. They just arrived together.
LCM(12,18) = 36 → they next arrive together in 36 minutes

Example 4 — Largest tile for a room:
Room 4.8m × 3.6m → GCD(480, 360) = 120 cm
Use 1.2m × 1.2m tiles — fits perfectly without cutting

Frequently asked questions

Yes — HCF (Highest Common Factor) and GCD (Greatest Common Divisor) are identical. HCF is the term commonly used in Indian school curriculum.
No. LCM is always ≥ the largest number. GCD is always ≤ the smallest number.
Yes, for exactly two numbers: GCD(a,b) × LCM(a,b) = a × b. This is a useful property for quick checks.