GCD & LCM Calculator
Find the greatest common divisor (GCD/HCF) and least common multiple (LCM) of two or more whole numbers.
Zero convention: gcd(a, 0) = |a|, lcm(a, 0) = 0, and gcd(0, 0) = 0. Core results use exact integers; prime factorization is skipped when its work budget would risk freezing the page.
Split teams fairly? Group generator · simplify fractions: Fraction calculator · averages: Average calculator.
How to use
Enter two or more signed integers, including zero. Exact GCD and LCM results update instantly; budgeted prime factorization and Euclidean steps (for pairs) help you verify homework without risking a long-running page.
FAQ
What are GCD and LCM?
GCD (greatest common divisor, also HCF) is the largest number that divides all your numbers. LCM (least common multiple) is the smallest number they all divide into.
How many numbers can I enter?
Enter two or more signed integers separated by commas, spaces, semicolons or new lines. Decimal values are rejected instead of truncated.
Can I include zero or negative integers?
Yes. This calculator uses gcd(a, 0) = |a|, lcm(a, 0) = 0, and the explicit convention gcd(0, 0) = 0. GCD and LCM results are non-negative.
What is it used for?
Simplifying fractions, scheduling repeating events and many math problems.
Can I see the steps?
Yes — for two numbers the Euclidean algorithm steps are listed. You can copy them or download a CSV summary.
Last updated: