Calculate Greatest Common Divisor (GCD/HCF) and Least Common Multiple (LCM) for two or more numbers. Step-by-step. 100% private. 100% free and private.
They are the same thing. GCD (Greatest Common Divisor) is the term used in most countries; HCF (Highest Common Factor) is common in the UK and South Asia.
We use the Euclidean algorithm, which repeatedly takes remainders. It runs in O(log n) steps and works for any pair of positive integers.
No. GCD with zero is defined but rarely useful. Enter positive integers only.
GCD is usually defined as positive. Strip the minus signs before entering values.
Up to 20 in the UI; the algorithm scales to any count.
JavaScript safe integers up to 2^53. Use BigInt-aware tools for cryptographic sizes.
GCD is defined as positive — the sign is dropped.
Yes — integer math, no floating-point error.
No. Local math only.
Find the Greatest Common Divisor (GCD or HCF) and Least Common Multiple (LCM) of two or more positive integers. Useful for simplifying fractions, ratio problems, and scheduling.
GCD is computed with the Euclidean algorithm: gcd(a,b) = gcd(b, a mod b). For more than two numbers we reduce pairwise. LCM uses the identity lcm(a,b) = a*b / gcd(a,b), again reduced across the list.
All computation is local. Your numbers stay on your device.
Related: Prime Number Checker, Scientific Calculator, Percentage Calculator.
Browse all free tools · Guides and tutorials · PDF tools · Developer tools · Text tools · SEO tools