GCD & LCM Calculator
Enter multiple integers separated by commas or spaces to find their greatest common divisor (GCD) and least common multiple (LCM), with prime factorization steps.
Enter two or more positive integers separated by commas, spaces, or line breaks.
Numbers:
Steps (Prime Factorization)
- GCD = product of prime factors common to every number
- LCM = product of every prime factor at its highest power
How to Use
Enter Integers
Type two or more positive integers separated by commas or spaces.
Calculate
Press the "Calculate" button to get the GCD and LCM.
Review & Copy
Check the GCD, LCM, and prime factorization steps, then copy as needed.
About GCD and LCM
The greatest common divisor (GCD) is the largest integer that divides all of the given numbers. The least common multiple (LCM) is the smallest integer that is a multiple of all of them. This tool uses the Euclidean algorithm to compute the GCD quickly, then derives the LCM. Everything runs in your browser, and BigInt keeps results accurate even for very large numbers.
Features
- Multiple IntegersCompute the GCD and LCM of two or many numbers at once.
- Step-by-stepSee a prime factorization table that explains the result.
- Big NumbersPowered by BigInt for accurate results without overflow.
- Privacy FirstAll processing happens in your browser. Nothing is sent to a server.
Use Cases
- Adding fractions (LCM of denominators, GCD to reduce)
- Checking math homework and exam preparation
- Cycle and timing problems (when events align again)
- Learning and verifying algorithms in programming
- Simplifying ratios to their smallest integer form
FAQ
How many integers can I enter?
Can I use decimals, negative numbers, or zero?
Can it handle very large numbers accurately?
How are the GCD and LCM calculated?
Are my numbers sent to a server?
Feedback
Missing a feature, or getting a result that looks wrong? Let us know — we improve our tools based on your feedback.