LCM & GCD Calculator
Find the Least Common Multiple (LCM) and Greatest Common Divisor (GCD / HCF) of two or more numbers with step-by-step solutions.
Compute both LCM and GCD simultaneously with verified product identity (a × b = GCD × LCM).
First integer
Second integer
GCD & LCM Results
How LCM and GCD Are Calculated
Pure integer mathematical formulas using the Euclidean algorithm, GCD-first LCM division, and product identities.
1. Least Common Multiple (LCM) Formula
The Least Common Multiple is the smallest positive integer divisible by both a and b. Dividing a by GCD(a, b) first prevents intermediate overflow before multiplying by b.
When to use: Use when finding common denominators for adding fractions or synchronizing recurring events.
2. Greatest Common Divisor (GCD / HCF) Formula
The Greatest Common Divisor (also known as Highest Common Factor or HCF) is the largest integer dividing both terms without a remainder. The Euclidean algorithm repeatedly replaces (a, b) with (b, a mod b) until the remainder is zero.
When to use: Use when simplifying fractions, factoring polynomials, or partitioning quantities equally.
3. Two-Number Product Identity
For any two positive integers, the product of their GCD and LCM strictly equals the product of the two original numbers.
When to use: Use to verify calculations or quickly find LCM when GCD is already known.
4. Multi-Number Associative Reduction
To find the GCD or LCM of three or more numbers, evaluate them sequentially in pairs: find the result of the first two numbers, then combine that result with the next number.
When to use: Use when solving scheduling problems or finding common multiples for 3 or more variables.
Practical Calculation Examples
Real-world scenarios illustrating step-by-step numbers, inputs, and verified outputs.
Example 1: LCM & GCD of 12 and 18
Compute both GCD and LCM for 12 and 18.
Example 2: Coprime Numbers 8 and 15
Find GCD and LCM for coprime integers 8 and 15.
Example 3: One Number Divides Another (6 and 24)
Compute GCD and LCM when one number is a multiple of the other.
Example 4: Three Numbers (12, 18, 24)
Compute multi-number GCD and LCM for 12, 18, and 24.
Example 5: Four Numbers (15, 20, 30, 45)
Compute multi-number GCD and LCM for four integers.
Example 6: Zero Edge Case (0 and 12)
Calculate GCD and LCM with a zero input.
Frequently Asked Questions
Clear answers to common questions about finding the Least Common Multiple, Greatest Common Divisor, HCF, coprime numbers, and negative inputs.
What is an LCM calculator?
An LCM calculator is a mathematical computation tool that determines the Least Common Multiple (the smallest positive integer divisible by all inputs) and Greatest Common Divisor (GCD/HCF) for two or more integers using the Euclidean algorithm and prime-reduction steps.
How do I find LCM using a calculator?
To find the LCM using this calculator, select 'LCM of Two Numbers' or 'Multiple Numbers', enter your positive integers, and the calculator instantly computes the exact LCM, prime factors, and step-by-step reduction.
How do I calculate the LCM of two numbers?
To calculate the LCM of two numbers a and b, divide the absolute value of a by their Greatest Common Divisor and multiply by b: LCM(a, b) = (|a| ÷ GCD(a, b)) × |b|. For example, for 12 and 18, GCD is 6, so LCM = (12 ÷ 6) × 18 = 36.
What is the difference between LCM and HCF/GCD?
LCM (Least Common Multiple) is the smallest positive number that is a multiple of all given numbers (greater than or equal to the largest number). HCF/GCD (Highest Common Factor / Greatest Common Divisor) is the largest integer that divides all given numbers evenly (less than or equal to the smallest non-zero number).
How do I find LCM and HCF together?
Select the 'Both LCM & GCD' mode and enter your two numbers. The calculator evaluates their GCD using the Euclidean division algorithm, then applies the product identity LCM = (a × b) ÷ GCD to display both values side by side with the verification product.
How are LCM and GCD related for two numbers?
For any two positive integers a and b, the product of their GCD and LCM strictly equals the product of the numbers: a × b = GCD(a, b) × LCM(a, b). This fundamental relationship applies to two-number pairs.
How do you find the LCM of three or more numbers?
You can find the LCM of multiple numbers by calculating the LCM of the first two numbers, and then finding the LCM of that result with the third number: LCM(a, b, c) = LCM(LCM(a, b), c). This pairwise reduction continues for all numbers.
What does it mean if two numbers are coprime?
Two numbers are coprime (or relatively prime) if their Greatest Common Divisor is 1. When two numbers are coprime, their LCM is simply their direct product (LCM = a × b).
Related Calculators
Explore connected academic, financial, and mathematical computation tools.