GCD & LCM Calculator
Common factors. Exact shared multiples.
GCD & LCM Calculator
Compare whole integers
Common factors. Exact multiples.
Two to twenty-five signed integers; commas, spaces, lines, semicolons or pipes. Up to 100 magnitude digits each.
Calculation and report options
One to twenty when the LCM is positive. A zero LCM has only the zero common multiple.
UTF-8 numeric data, up to 64 KiB. Exported report CSV contains headers and is not an import template.
Fractions, decimals and exponent notation are rejected. Signs and leading zeros normalize exactly. Finite divisor enumeration is available when the positive GCD is at most 100,000,000. Larger GCDs retain exact results and certificates.
Exact GCD and LCM
Exact GCD and positive LCM verified. Signs do not change either magnitude; source order and duplicates remain in the report.
Understand the list
GCD (also HCF or GCF) is reported nonnegative. LCM is positive for nonzero inputs and conventionally zero if any input is zero. Input signs do not change these magnitudes.
Collectively coprime
No: the whole-list GCD is not one.
Pairwise coprime
No: at least one pair has a GCD other than one.
A whole-list GCD of one does not by itself make every pair coprime. Use the optional pairwise report to inspect the difference.
Reduced signed ratio
Bézout and divisibility certificates
The exact linear combination equals the GCD. Its coefficients apply to the signed original inputs. Together with the divisibility checks this certifies the common divisor; coefficients are not unique. The all-zero identity does not assert a greatest positive divisor.
Input 1
Input 2
Input 3
Step-by-step Euclidean algorithm
Merge 1: combine the preceding GCD with the next magnitude. Remainders stay nonnegative. The final nonzero remainder is the new GCD; if the next magnitude is zero, no division is needed.
Working page 1 of 1. Complete working for every merge remains in copy and CSV.
Division 1
Division 2
Division 3
LCM recurrence for this merge
The running LCM has its own GCD with the next magnitude. It is different from the running list GCD. A zero operand sets this LCM to zero without division.
Positive common divisors
These are all positive divisors of the exact GCD. The complete bounded list contains values.
Divisor page 1 of 1. Total positive common divisors: 4. Copy and CSV retain the complete list.
First positive common multiples
Multiply the exact LCM by successive positive integers. The selected count changes this list only.
Create a complete common-factor and multiple record
Simplified integer relationships
Reduce an entire signed integer ratio by its nonnegative GCD, keeping zeros and signs where they belong. Compare the reduced components with the original list to see exactly what the shared factor removes. An all-zero list receives a dedicated explanation because dividing its ratio by the zero GCD is not a valid simplification.
Repeat-cycle and denominator checks
Use the positive LCM to identify a shared repeat count or common denominator when every input is nonzero. Inspect the first selected positive multiples as exact integers rather than rounded estimates. A zero input changes the question: the tool reports the conventional zero LCM and explains why there is no positive shared multiple in that case.
A checkable list-wide certificate
Keep the Euclidean divisions and signed Bézout coefficients with the final answer. The full report records every left-to-right merge and every independent pair, so it can be reviewed after compact panels are hidden. Source positions remain distinct, which matters when repeated values appear in a pairwise audit or when an input list has been deliberately reordered.
GCD and LCM formulas with step-by-step examples
For two integer inputs, write . If both are nonzero, their least positive common multiple is . Division precedes multiplication, keeping the recurrence clear. If either input is zero, this calculator uses ; if both are zero, it also uses . These computational conventions do not create a greatest positive divisor or a positive multiple for an all-zero list.
Follow Euclid on a signed pair
Normalize the magnitudes, divide until the remainder becomes zero, and retain the final nonzero remainder. Restore the original signs only when forming the coefficient certificate.
Check the pair product and linear combination
The GCD and LCM reproduce the absolute product for two numbers. A separate signed linear combination verifies that the common divisor is attained by integer coefficients.
Extend by separate recurrences
Merge the first two magnitudes, then include the next input. The LCM denominator is the GCD of the running LCM and the new magnitude, rather than the running list GCD.
Distinguish collective and pairwise tests
No factor greater than one divides all three inputs, but each of the three pairs shares a different factor. This is a useful counterexample to an overly strong coprimality conclusion.
For a list, initialize and . Continue with and . Euclid uses with whenever . Extended Euclid supplies coefficients satisfying . A positive integer is a common divisor of the list exactly when it divides ; this equivalence also explains the infinite common-divisor set when every input is zero.
These identities provide distinct checks. Divisibility alone shows that a candidate is common, while the Bézout combination confirms that no larger positive common divisor can divide all inputs when the result is positive. The LCM recurrence establishes the least-positive property for nonzero lists; merely finding a large number divisible by every input would establish a common multiple without proving that it is the least one.
Keep every integer exact and every inference specific
Exact values and explicit conventions
- Integer source strings use BigInt arithmetic, preserving adjacent large integers beyond native floating-point precision. A fractional or malformed token cannot silently become a different integer question.
- Nonnegative GCD and LCM magnitudes are separate from signed ratio components and signed Bézout coefficients. Zero explanations avoid division by zero and distinguish a convention from a positive-number extremum.
- The computation does not depend on complete prime factorization. Exact Euclidean answers remain available for supported large inputs even when enumerating their common divisors is intentionally withheld.
Verification you can reproduce
- Inspect one merge at a time, including its Euclidean quotient and remainder rows and its separate LCM recurrence. Changing the visible page never changes the verified result or the full exported working.
- Compare collective coprimality with every indexed pair. Input duplicates are retained unless explicitly removed, while sorting or using magnitudes are deliberate input edits with immediately recomputed certificates.
- Share the numerical source and report settings, retain a complete CSV, or print a focused report. Invalid imports leave existing data intact, and invalid edits disable result actions instead of copying a stale answer.
Useful for number sense, exact arithmetic and repeated cycles
Students learning divisibility
Connect common factors, simplified ratios and common multiples with the actual Euclidean remainders. Compare a pair with a longer list before applying a product identity, and use a counterexample to understand why collective and pairwise coprimality must be distinguished.
Teachers preparing worked answers
Show a chosen merge without overwhelming a small screen with every division at once. Keep the full Bézout and pairwise audit in downloadable working, and use signed and zero examples to make the scope of familiar positive-integer rules explicit.
Technical readers checking integer cycles
Calculate an exact repeat count for nonzero integer periods or inspect a large common scale factor without rounded notation. The tool works with discrete counts, not measurements with uncertainty, unit conversion, calendars or practical scheduling constraints.
How it works in three quick steps.
Enter the complete integer list
Enter between two and twenty-five signed whole-number decimals, using spaces, lines, commas, semicolons or pipes to separate them. Keep grouping commas out of individual values: a comma starts another input rather than marking thousands. Decimals, fractions, exponent notation and empty delimiter cells are rejected. Every integer supports up to one hundred magnitude digits without conversion to native floating-point numbers.
Read the exact GCD and LCM
Compare the nonnegative GCD with the positive LCM, or read the special zero convention when any input is zero. Inspect the reduced signed ratio and distinguish a whole-list GCD of one from pairwise coprimality. Select a merge to follow the Euclidean divisions and the separate running-LCM recurrence. The order of merging can change the working but does not change either final magnitude.
Verify, explore and keep the report
Check the signed-input Bézout coefficients and the divisibility identities. Turn on the pairwise report, browse bounded common divisors and choose how many positive common multiples to list. Copy the complete explanation or result LaTeX, download all working as CSV, share the input and report options, or print the visible report. Complete exports retain working and pairs outside the current visual page.
Save complete working or print a focused explanation
Copy exact values and notation
Copy summary retains every Euclidean division, all merge results, indexed pairs and the complete generated common-divisor list even if panels are hidden. Copy LaTeX provides the exact GCD, LCM and signed Bézout expressions for a mathematics document. The visual page selector controls browsing, not the content of the complete text report.
Download an exact CSV report
A rectangular four-column CSV separates record type, input or merge position, label and value. One divisor or pair result is stored per row rather than filling a single oversized spreadsheet cell. Long integer cells are marked as text to prevent spreadsheet software from rounding their last digits. Keep that text marker when reviewing exported exact values.
Print or save a readable PDF
Use Print / Save PDF after selecting the working and pair pages you want to explain. The report retains the zero convention, headings and mathematical notation while removing navigation and editable controls. Very long expressions use explicit print notices; the on-screen mathematics, complete copy and CSV retain the exact values. Print at actual size or a readable scale and check the preview before saving.
Frequently Asked Questions
Are GCD, GCF and HCF different calculations?
What happens when one or every input is zero?
Do negative signs change the GCD or LCM?
Why does a whole-list GCD of one not imply pairwise coprimality?
Can I multiply the GCD and LCM to get the product of an entire list?
How do the Euclidean steps and Bézout coefficients verify a result?
Why are some common-divisor lists or printed expressions limited?
What can I import, share, copy and download?
About this GCD & LCM Calculator
The GCD & LCM Calculator turns a signed integer list into an exact, reviewable arithmetic record. Its purpose is broader than returning two values: the result connects divisibility, reduced ratios, repeat multiples and integer linear combinations while naming the assumptions that make each interpretation valid. The source stays textual until strict integer parsing, and BigInt arithmetic keeps all supported digits intact. There is no decimal truncation or approximate least common multiple hidden behind a formatted number.
The computational method uses Euclid's algorithm and its extended form. That choice matters because finding a common divisor does not require discovering every prime factor of a large integer. The calculator can therefore retain exact GCD and LCM results beyond its intentionally small common-divisor enumeration domain. Positive common divisors are completely listed only within the stated bound. An all-zero list instead has an infinite common positive-divisor set, and the report preserves that distinction rather than presenting an empty list as the answer.
For longer lists, the tool folds the inputs in their original order. Intermediate divisions and one valid Bézout coefficient set can change after reordering, although the final GCD and LCM do not. Pairwise checks keep original input positions distinct, including duplicates. The reduced ratio retains the original signs, while GCD and LCM use their standard nonnegative normalization. Local imports, explicit list transformations and shareable settings support reproducible examples. Complete copied and downloaded working retain detail beyond a compact screen view, while the print report follows the selected visual pages and explains any long-expression fallback.
Who maintains this page
Ownership and review
Written and maintained by the Toolarithm editorial team. No review date is shown without a maintained editorial record. No independent professional review is claimed.
Methodology
Equations are checked by substituting worked examples into the stated relationship and comparing the result with the interactive implementation.
Read the editorial methodologyDates and sources
Review dates change only after a substantive method or content check.
Keep building