GCD & LCM Calculator
Find the GCD and LCM of several numbers at once, with each number's prime factorization — big-number accurate, in your browser.
12=2^2 × 318=2 × 3^224=2^3 × 3
🔒 All calculations happen only in your browser.
Several numbers at once
Enter two or more positive integers separated by commas or spaces to get the GCD and LCM together — 12 and 18 give a GCD of 6 and an LCM of 36. It handles three or more numbers too, useful for fractions, cycles and packaging problems.
With prime factorization
Each number is broken into a product of primes, e.g. 12 = 2²×3, 18 = 2×3². Seeing the factorization makes it clear why the GCD and LCM come out as they do — handy for learning.
Big-number accurate
Ordinary calculators can lose precision on large values; this tool uses integer-only BigInt arithmetic and the Euclidean algorithm, so even large GCD/LCM results are exact.
Frequently asked questions
How many numbers can I enter?
Any count of two or more, separated by commas or spaces.
How is the LCM found?
It is the product of two numbers divided by their GCD, applied successively for more numbers.
Does it show prime factorization?
Yes, each input is shown as a product of primes, e.g. 12 = 2²×3.
Are inputs stored?
No. Everything is computed only in your browser.