GCD and LCM Calculator
Compute the greatest common divisor (GCD) and least common multiple (LCM) of any list of whole numbers at once. Type the numbers and the results update instantly.
How to find the GCD and LCM
- Type two or more integers, separated by commas or spaces.
- Read the GCD (greatest common divisor) from the first result card.
- Read the LCM (least common multiple) from the second result card.
Examples
Two numbers
12, 18
GCD = 6, LCM = 36
Three numbers
4, 6, 8
GCD = 2, LCM = 24
Frequently asked questions
What is the greatest common divisor (GCD)?
The GCD, also called the greatest common factor (GCF) or highest common factor (HCF), is the largest whole number that divides every number in the list with no remainder.
What is the least common multiple (LCM)?
The LCM is the smallest positive whole number that every number in the list divides into evenly. It is a common multiple of all of them.
How are the GCD and LCM calculated?
The GCD is found with the Euclidean algorithm, repeatedly taking remainders until one reaches zero. The LCM uses the identity lcm(a, b) = |a / gcd(a, b) * b|. For longer lists the calculator folds each result across the numbers two at a time.
Can I enter more than two numbers?
Yes. Enter as many integers as you like. The GCD and LCM are reduced across the whole list, so the answers apply to every number at once.
What are the GCD and LCM used for?
The GCD reduces fractions to lowest terms and simplifies ratios. The LCM finds common denominators and solves scheduling problems, such as when two repeating events line up again.
Why are zero and decimals rejected?
The tool works on non-zero integers. Every number is a multiple of zero and the GCD of all zeros is undefined, while decimals do not have a well-defined GCD or LCM.
Related tools
Prime Number Checker
Check if a number is prime and see its full prime factorization and all divisors. Enter any whole number and get an instant answer.
Ratio Calculator
Solve a proportion A:B = C:D by leaving one value blank, or simplify a ratio to its lowest terms. Free, fast and works in your browser.
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.