LCM and GCD Calculator
Enter two or more whole numbers to find their greatest common divisor (GCD) and least common multiple (LCM) at once. Handles any count of integers, including zeros.
How to find the GCD and LCM
- Enter your integers separated by commas or spaces.
- Read the GCD (largest number dividing all of them) and LCM (smallest number they all divide into).
- Copy either result.
Examples
GCD of 12 and 18
12, 18
GCD 6, LCM 36
LCM of 2, 3, 4
2, 3, 4
GCD 1, LCM 12
Frequently asked questions
What is the difference between GCD and LCM?
The GCD is the largest integer that divides every number, while the LCM is the smallest positive integer that every number divides into evenly.
How is the GCD calculated?
This tool uses Euclid's algorithm, repeatedly replacing the larger number with its remainder until one value reaches zero. The other value is the GCD.
Can I enter more than two numbers?
Yes. Enter as many integers as you like and the calculator folds the GCD and LCM across the whole list.
What happens if I include zero?
The GCD with zero ignores it, while any LCM that includes zero is defined as zero, which the tool reports accordingly.
Is HCF the same as GCD?
Yes. Highest common factor (HCF) is just another name for the greatest common divisor (GCD).
Related tools
Factorial Calculator
Calculate the factorial of any non-negative integer with exact big-number precision. Get n! instantly, even for large values, then copy the result. Free.
Proportion Calculator
Solve a proportion a/b = c/d for the missing value. Leave one box blank and get the answer by cross multiplication, instantly and free. No signup needed.
Area Calculator
Find the area of a circle, square, rectangle, triangle, trapezoid, parallelogram, ellipse, sector or rhombus. Free and runs in your browser.
Arithmetic Sequence Calculator
Find the nth term, the sum of n terms and the full term list for any arithmetic or geometric sequence. Enter the first term, step or ratio, and n.
Average Calculator
Find the mean, median, mode, range, sum, count, min and max of a list of numbers. Paste values separated by commas, spaces or new lines.
Big Number Calculator
Add, subtract, multiply, divide, power, modulo, factorial, GCD and LCM on integers of any length. Exact results with no rounding, computed in your browser.