GCD and LCM Calculator
Find the greatest common divisor and lowest common multiple of two or more numbers.
Your result will appear here as soon as you add some input.
How to use it
- 1Enter your values in the fields above.
- 2The answer and the working appear immediately below.
- 3Check the working to see the formula with your numbers substituted.
Example
Input
12, 18
Output
GCD 6, LCM 36
About the GCD and LCM Calculator
The GCD is the largest number that divides all of them; the LCM is the smallest number they all divide into. The GCD is what simplifies a fraction, and the LCM is what finds a common denominator.
Euclid’s algorithm is used for the GCD: repeatedly replace the larger number with the remainder of dividing it by the smaller. It is over two thousand years old and still the fastest practical method.
The prime factorisation of each number is shown, since that is how the two quantities are usually taught: the GCD takes the lowest power of each shared prime, the LCM the highest power of every prime.
Questions people ask
Is your figures uploaded to a server?
No. This tool runs entirely in your browser using standard web APIs, so your figures never leaves your device. You can confirm it by opening your browser's network panel while the tool runs, or by disconnecting from the internet after the page has loaded.
Is it free, and do I need an account?
Yes, it is free, and there is no account, no sign-up and no watermark on the result. The project is funded by optional donations.