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.

Last updated: 2026/10/16 Calculator Feedback & bug reports
Enter Integers

Enter two or more positive integers separated by commas, spaces, or line breaks.

Result
Enter integers and press "Calculate".

How to Use

1

Enter Integers

Type two or more positive integers separated by commas or spaces.

2

Calculate

Press the "Calculate" button to get the GCD and LCM.

3

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?
There is no fixed limit. Enter two or more positive integers separated by commas, spaces, or line breaks.
Can I use decimals, negative numbers, or zero?
This tool supports positive integers only. Decimals, negatives, or zero will produce an error.
Can it handle very large numbers accurately?
Yes. It uses JavaScript BigInt, so it stays accurate even beyond the normal numeric limit, without overflow.
How are the GCD and LCM calculated?
The GCD is found with the Euclidean algorithm. The LCM is built up using "product of two numbers / GCD". The prime factorization shown is an aid to understanding the steps.
Are my numbers sent to a server?
No. All calculations run entirely in your browser, and the numbers you enter are never sent to or stored on any external server.