GCD & LCM Calculator
Find the greatest common divisor and least common multiple of two integers using the Euclidean algorithm. no signup required, no upload required.
- Free, no sign-up
- REST + MCP
- Updated
- Reviewed by Olgun Ozoktas
- GCD (greatest common divisor)
- 12
- LCM (least common multiple)
- 720
Why use this GCD and LCM calculator?
The greatest common divisor is the largest whole number that divides both inputs; the least common multiple is the smallest number both divide into. They turn up constantly in fraction arithmetic, scheduling problems, and number theory homework. This tool uses the Euclidean algorithm, so it stays fast even on large inputs, and it runs entirely in your browser.
Frequently Asked Questions
What is the difference between GCD, HCF, and GCF?
They are three names for the same thing. GCD (greatest common divisor), HCF (highest common factor), and GCF (greatest common factor) all mean the largest whole number that divides both inputs exactly.
How is the GCD calculated?
With the Euclidean algorithm: repeatedly replace the larger number with the remainder of dividing it by the smaller one, until the remainder is zero. The last non-zero value is the GCD. It takes very few steps even for large numbers.
How is the LCM derived from the GCD?
LCM(a, b) = a × b ÷ GCD(a, b). Dividing by the GCD first avoids overflowing on large inputs.
What happens if I enter zero?
GCD(a, 0) is a, because every number divides zero. The LCM with zero is zero.
Is there an API for this?
Yes. The same calculation is available over REST and MCP as the tool id gcd_calculate, taking two integers a and b.
Do I need an account?
No. This tool requires no signup, no usage limits, and no watermarks.