GCD & LCM Calculator
Calculate the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of two or three numbers.
Did this tool work for you?
How to use this calculator
GCD is found by repeatedly dividing the larger number by the smaller and taking remainders until zero. LCM is derived from GCD.
- 1
Enter two or three positive integers.
- 2
Leave the third number as 0 to calculate for just two numbers.
- 3
The calculator shows GCD and LCM with factor lists for verification.
Frequently asked questions
What is GCD used for?
GCD (Greatest Common Divisor, also called HCF — Highest Common Factor) is used to simplify fractions. The fraction 48/18 simplifies to 8/3 by dividing both by GCD(48,18) = 6. It is also used in ratio simplification and modular arithmetic.
What is LCM used for?
LCM (Least Common Multiple) is used to add or subtract fractions with different denominators (find the common denominator), determine when repeating events coincide, and solve problems involving gear ratios, traffic lights, or scheduling.
How does the Euclidean algorithm work?
GCD(48, 18): divide 48 by 18, remainder 12. GCD(18, 12): divide 18 by 12, remainder 6. GCD(12, 6): divide 12 by 6, remainder 0. When remainder is 0, the divisor (6) is the GCD. This algorithm is O(log n) — very efficient even for large numbers.
What is the relationship between GCD and LCM?
GCD(a,b) × LCM(a,b) = a × b. This means once you have the GCD, you can always find the LCM quickly without listing multiples: LCM = (a × b) / GCD.
GCD and LCM in mathematics
How to use the gcd & lcm
Use this gcd & lcm to he greatest common divisor (gcd) and least common multiple (lcm) of two or three numbers. Enter your values above and get your result in seconds. The tool is free, works on all devices, and keeps your data private — nothing is stored or shared.
How the gcd & lcm works
The gcd & lcm calculator uses standard formulas used in mathematics, science, and engineering. Enter your inputs, and the tool calculates the result instantly in your browser. No server-side processing means your data stays on your device. Results update in real time as you change inputs.
Finding GCD using the Euclidean algorithm
The Euclidean algorithm is one of the oldest algorithms in existence, described by Euclid around 300 BC. It works by repeated division: GCD(a,b) = GCD(b, a mod b), stopping when the remainder is 0. It is efficient enough to handle numbers with thousands of digits.
Finding LCM by listing multiples
For small numbers, you can list multiples of each and find the first common one. Multiples of 4: 4, 8, 12, 16… Multiples of 6: 6, 12… LCM = 12. For larger numbers, use LCM = (a×b)/GCD — far more efficient.
GCD and LCM with more than two numbers
For three numbers, apply GCD/LCM iteratively: GCD(a,b,c) = GCD(GCD(a,b), c). Same for LCM. This extends to any number of inputs. Useful in scheduling problems where multiple cycles must align.
Gcd & lcm: how it works
Built on well-established mathematical principles, this tool delivers accurate results for students, researchers, and professionals. Enter your values and get instant clarity without specialist software or manual arithmetic.
Who uses this tool?
Teachers, students, engineers, and data analysts use it to verify calculations, check homework, and solve problems faster. It is intuitive enough for beginners while comprehensive enough for professional use.
Learn more from an authoritative source:
WikipediaScientific Calculator
Evaluate mathematical expressions including trigonometry, logarithms, exponents, and more.
Percentage Calculator
Quickly calculate percentages, percentage change, and percentage of a total.
Fraction Calculator
Add, subtract, multiply, or divide two fractions and get the simplified result instantly.
Ratio Calculator
Simplify ratios, find missing values, and scale ratios up or down.
Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →