GCD & LCM Calculator: what this tool is for
In number theory and elementary arithmetic, the Greatest Common Divisor (GCD, also known as Greatest Common Factor GCF) and the Least Common Multiple (LCM) are fundamental concepts characterizing integer divisibility. The GCD is the largest positive integer that divides two or more numbers without leaving a remainder, while the LCM is the smallest non-zero positive integer that is an exact multiple of all given numbers.
The determination of the GCD historically relies on Euclid's algorithm, an elegant succession of Euclidean divisions where the last non-zero remainder equals the GCD. For any two positive integers a and b, the LCM is directly linked to the GCD via the universal identity: GCD(a, b) × LCM(a, b) = a × b.
An alternative approach uses prime factorizations: the GCD is the product of all shared prime factors raised to their lowest exponent, while the LCM is the product of all prime factors (shared or unique) raised to their highest exponent. When the GCD equals 1, the numbers are termed coprime (relatively prime).
This free online GCD & LCM Calculator processes 2 to 4 integers simultaneously, generating full Euclidean step-by-step division tables, prime factorization factor trees, Bézout's identity coefficients, and complete lists of common divisors and multiples.
No file stored
Nothing is saved on our servers, during or after processing.
Local processing
The computation runs in your browser whenever the technology allows it.
Instant result
No waiting and no export queue: the result appears live.
Free, no account
No sign-up, no daily limit and no intrusive ads.
What this tool gives you
Step-by-step Euclidean algorithm divisions
Inspect the full successive division table (dividend = divisor × quotient + remainder) leading directly to the GCD.
Canonical prime factorization
View prime factor trees formatted with exponential notation for all input numbers (e.g., 180 = 2² × 3² × 5).
Bézout's identity & coefficients u and v
Calculate integer Bézout coefficients satisfying a·u + b·v = GCD(a, b) using the Extended Euclidean algorithm.
Multi-integer calculation mode (3 to 5 numbers)
Compute the combined GCD and LCM of 3 or more numbers in a single calculation for periodic signal synchronization.
Real-world examples
Review standard GCD, LCM, and prime factorization pairs:
How to use GCD & LCM Calculator
Select your computation mode
Choose between '2 Numbers (Euclid & Bézout)' or 'Multi-Numbers (3 to 5 integers)'.
Enter your positive integers
Type your whole numbers (e.g., 48 and 180).
Review the GCD and LCM
Inspect the primary GCD and LCM values, coprime status, and Bézout linear equation.
Explore Euclidean steps & prime factors
Follow the step-by-step division table and prime factor decompositions for homework and exams.
Tips and mistakes to avoid
Derive LCM directly once GCD is known
Whenever you know the GCD of two numbers a and b, find the LCM instantly via LCM(a, b) = (a × b) / GCD(a, b). For example, with 12 and 18 (GCD = 6), LCM = (12 × 18) / 6 = 216 / 6 = 36.
Consecutive integers are always coprime
For any integer n, GCD(n, n+1) = 1. Numbers like 14 and 15 or 99 and 100 never share any common factor other than 1.
Avoid : Confusing GCD with LCM
The GCD is always less than or equal to the smaller input number, whereas the LCM is always greater than or equal to the larger input number.
Avoid : Stopping Euclidean division too early
The GCD is not the division quotient, but the last non-zero REMAINDER before remainder 0 is reached.
Frequently asked questions
Answers to the questions people ask about GCD & LCM Calculator.
Related tools
Tools people open right after this one.
Add, subtract, multiply, divide, and simplify fractions with mixed numbers, decimal conversions, and step-by-step reduction.
Solve any ax² + bx + c = 0 quadratic equation with discriminant Delta, real/complex roots, vertex, and canonical form.
Calculate mean, median, mode, standard deviation, sample/population variance, quartiles Q1/Q3, and range for any data set.
Updated on August 2026. See all tools