GCD and LCM calculator

Compute the greatest common divisor and least common multiple of integers.

Your files are processed here, on your device

We do not send your file or text contents to a processing server. No account is needed and there is no daily operation quota. Individual tools have size limits to protect your device’s memory.

A connection is needed to load the site and its resources. Hosting may receive technical visit data. Favorites store only tool identifiers in this browser.

How we handle your data →

How to use this tool

  1. Enter integers separated by spaces, lines, commas or semicolons.
  2. Calculate using absolute magnitudes and check for zero inputs.
  3. Inspect GCD, LCM and entry count, then retain the summary.

An example you can verify

Check a shared divisor and a multiple containing all three quantities.

Example input

24 36 60

SettingsSpace-separated integers.

Expected result

GCD: 12
LCM: 360

12 divides every input. 360 is divisible by 24, 36 and 60. Changing an input sign does not change these results.

GCD and LCM calculator: uses and practical guidance

The greatest common divisor is the largest positive integer dividing every magnitude in a list without remainder. The least common multiple is the smallest shared positive multiple when no input is zero. These operations help inspect divisibility, simplify related quantities or find a shared repetition of cycles expressed as integers. The tool accepts several values at once and displays how many entries were interpreted. It also works for two values, but does not stop after the first pair or ignore later entries. Interpretation therefore depends on the complete supplied list rather than an automatically selected subset.

Absolute values are used. Entering -24, 36 and 60 produces the same results as 24, 36 and 60: GCD 12 and LCM 360. Repeated values do not change the mathematical results, although they count as supplied entries. If any value is zero, LCM is shown as zero. GCD of zero and another number equals that number's magnitude; for an all-zero list, this interface uses zero. These conventions are visible so special cases can be interpreted without assuming inputs were discarded. Inspect zero-containing examples separately when checking whether a result suits a particular mathematical application.

Separators are spaces, line endings, commas and semicolons. They do not act as decimal marks or thousands separators. Writing 1,5 supplies integers 1 and 5; write 1500 without punctuation for one thousand five hundred. Fractions, decimal-point values and exponential notation are not interpreted as integers. Each entry accepts up to one hundred digits with an optional sign. Calculation uses exact large-integer arithmetic rather than converting long values to floating-point numbers, so it does not depend on the ordinary safe-integer limit used by several other browser calculators. Output is text containing the exact resulting integers.

Divisors are found using Euclid's algorithm, and multiples are combined by dividing before unnecessary multiplication. Exact arithmetic does not prevent results from containing far more digits than inputs. Up to one hundred integers are accepted, and output length is bounded to keep the operation manageable. Check a small example by dividing every input by GCD and dividing LCM by each nonzero input. GCD equal to one means there is no shared divisor greater than one, but does not imply every input is prime. Retain the initial list when explaining the result or repeating the calculation after adding another quantity.

Settings and limits

Enter up to 100 integers separated by spaces, commas, semicolons or line breaks. Absolute values are used. Results use exact large-integer arithmetic with up to 100 digits per input. If any input is zero, LCM is zero; GCD of an all-zero list is shown as zero.

Frequently asked questions

Are decimal values supported?

No. Separators divide integers rather than acting as decimal marks or thousands separators.