LCM & GCD Calculator
Find LCM and GCD of two numbers.
math
Adjust the inputs below
Ready when you are
Adjust the inputs on the left to see your gcd (hcf).
Introduction to the LCM & GCD Calculator
The LCM & GCD Calculator is a free online tool that finds the Lowest Common Multiple and Greatest Common Divisor (also called HCF) of two or more numbers. The core relation is LCM(a, b) x GCD(a, b) = a x b, so finding one gives the other instantly.
Indian students from class 5 to college, competitive exam aspirants and engineering candidates use this LCM HCF tool every week. Whether you study CBSE class 6 in Mumbai, CTET preparation in Lucknow or quantitative aptitude in Bengaluru for IBPS PO, the prime factorisation and Euclidean algorithm stay fundamental. Related concepts like prime numbers, factors, divisibility rules and fractions all sit on top of LCM and HCF.
Inputs are 2 to 10 positive integers. Outputs are the LCM, GCD, prime factorisation breakdown and step-by-step working that students can copy in homework or exam notebooks.
Who Should Use This LCM & GCD Calculator
- CBSE class 6-8 students in Delhi solving NCERT exercises on multiples and factors.
- Engineering aspirants in Kota practising number theory for JEE Main quantitative section.
- CAT and SSC CGL aspirants in Pune drilling LCM-HCF based ratio and proportion problems.
- Bank exam aspirants in Hyderabad solving time, speed, distance and work questions in IBPS PO.
- Tuition teachers in Chennai preparing class worksheets and practice tests for math students.
Tips for LCM and HCF Problems
Smart LCM and HCF Tips
- For two numbers, find HCF first using Euclidean division, then LCM = (a x b) / HCF. Saves 2-3 minutes per question.
- Practise prime factorisation up to 100, since competitive exam answers usually involve products of 2, 3, 5, 7, 11, 13.
- Use the listing method only for small numbers below 30, otherwise factorisation is faster.
- Buy a basic scientific calculator like Casio FX-82MS (around Rs 800) for school but solve manually in exams since electronic calculators are banned in CBSE and JEE.
- Memorise this rule: LCM of two co-prime numbers (HCF = 1) is simply their product.
Formula Explanation
Core LCM & GCD Formula
GCD (Euclidean): GCD(a, b) = GCD(b, a mod b), recursive until b = 0 LCM = (a x b) / GCD(a, b) For 3+ numbers: GCD(a, b, c) = GCD(GCD(a, b), c) LCM(a, b, c) = LCM(LCM(a, b), c)
Where:
- mod = remainder after division
- GCD = greatest common divisor (also called HCF)
- LCM = lowest common multiple
Example: Numbers 12 and 18. GCD: 18 mod 12 = 6, 12 mod 6 = 0, so GCD = 6. LCM = (12 x 18) / 6 = 36.
LCM & GCD Quick Reference Table
| Numbers | Prime Factors | GCD (HCF) | LCM |
|---|---|---|---|
| 12, 18 | 2x2x3, 2x3x3 | 6 | 36 |
| 24, 36 | 2^3 x 3, 2^2 x 3^2 | 12 | 72 |
| 15, 25 | 3 x 5, 5 x 5 | 5 | 75 |
| 30, 45, 60 | mixed | 15 | 180 |
| 8, 9 | 2^3, 3^2 | 1 (co-prime) | 72 |
Real-World Example
Example: Aditi's Class 6 Math Problem
Meet Aditi, an 11 year old CBSE class 6 student from Pune who needs to find the LCM and HCF of 36 and 48 for tomorrow's math test on multiples and factors.
Step 1: Prime factorise: 36 = 2 x 2 x 3 x 3 and 48 = 2 x 2 x 2 x 2 x 3. Step 2: HCF = product of common prime factors = 2 x 2 x 3 = 12. Step 3: LCM = (36 x 48) / 12 = 1728 / 12 = 144.
Result: Aditi confirms LCM = 144 and HCF = 12. She also verifies using the relation 36 x 48 = 1728 = 144 x 12, and scores full 5 marks on the test.
Frequently Asked Questions About LCM & GCD
Indian school students, competitive exam aspirants and tuition teachers often ask about quick LCM and HCF tricks, the relationship between them and how to handle 3 or more numbers. The answers below cover NCERT patterns, common exam shortcuts and the Euclidean algorithm in simple steps.
LCM & GCD Calculator — frequently asked questions
How does the LCM and GCD Calculator work?
GCD (Greatest Common Divisor) is the largest integer that divides all input numbers without a remainder. LCM (Least Common Multiple) is the smallest integer that all inputs divide into evenly. The relationship GCD(a,b) x LCM(a,b) = a x b holds for any two integers. The calculator uses the Euclidean algorithm for GCD and derives LCM from that.
How accurate is the LCM and GCD math?
LCM and GCD calculations are mathematically exact for integer inputs of any size the browser can represent. The Euclidean algorithm is provably correct and one of the oldest algorithms still in active use. For very large numbers above 2^53 (the JavaScript integer limit), the calculator uses BigInt arithmetic to stay precise without precision loss.
What inputs does the LCM and GCD Calculator need?
Enter two or more positive integers separated by commas, spaces, or one per line. The calculator returns the GCD, the LCM, the prime factorisation of each input, and a step-by-step working showing the Euclidean algorithm reduction. It handles up to 20 numbers in a single calculation, useful for problems involving multiple denominators or shared time cycles.
When do I need LCM versus GCD in real life?
Use LCM when combining cycles or fractions: finding when two events repeating on different schedules will coincide, or finding a common denominator for adding fractions. Use GCD when simplifying fractions to lowest terms, dividing items into equal groups, or finding the largest tile that fits a rectangular area exactly. Both appear in scheduling, packaging, and resource allocation problems.
Is the LCM and GCD Calculator free?
Yes, the LCM and GCD Calculator is free on AllSmartCalculators with no signup, ads inside the form, or login. Works on any device. Bookmark it for math homework, fraction simplification, scheduling problems, computer science modular arithmetic, cryptography exercises, and any situation requiring integer divisibility analysis without firing up a math library.
What other math calculators pair with this one?
Pair the LCM and GCD Calculator with the Fraction Calculator (for adding fractions with different denominators), the Prime Number Checker (for understanding the prime factorisations that underlie LCM and GCD), and the Ratio Calculator. The Factorial Calculator helps with combinatorial problems that also involve divisibility.
Embed this calculator
Free to use on your own site — no signup, no key, no limits. Paste this where you want the calculator to appear. Please keep the attribution line; it is the only thing we ask in return.
Add ?theme=light to the embed URL for a light background. The frame reports its own height to the parent window as a asc-embed-height message if you would rather size it automatically than use the fixed 620px.
Related calculators
Percentage Calculator
Find X% of a number, percentage increase, percentage decrease, and percent difference — all in one tool.
Fraction Calculator
Add, subtract, multiply & divide fractions.
Quadratic Equation
Solve ax² + bx + c = 0.
Statistics Calculator
Mean, median, mode, and std deviation.

