GCD & LCM Calculator
Greatest common divisor and least common multiple

🔒 Browser-side · Method · · Disclaimer · GCD & LCM Calculator
Working out greatest common divisor and least common multiple is easier with GCD & LCM Calculator, which answers as you type. Fill in First Number and Second Number on GCD & LCM and read your answer immediately. GCD & LCM displays each intermediate figure as well. Anyone comparing options in Utilities can use GCD & LCM to compare scenarios. No sign-up is needed for GCD & LCM. The math runs on your device. GCD & LCM sits in the Utilities section next to free online gcd & lcm calculator and gcd lcm calculator greatest common divisor least common multiple. GCD & LCM is designed for real people. Labels stay plain. Try GCD & LCM now and keep it handy.
What does the GCD & LCM Calculator do?
GCD & LCM Calculator works out the gcd from the First Number and Second Number, using Utilities conventions. With the defaults, gcd & lcm calculator gives a result of 6 | LCM: 36.
- Inputs: First Number and Second Number.
- Output: the gcd, followed by the terms it was built from.
- Method: the standard Utilities method for the gcd, run locally in your browser.
Quick answer
gcd & lcm calculator returns a result of 6 | LCM: 36 with the default inputs (first number of 12, second number of 18).
How does the GCD & LCM Calculator work?
GCD & LCM Calculator computes the gcd directly from your inputs — the First Number and Second Number feed the formula. The gcd is calculated in the browser, so the inputs never leave the device.
What This Calculator Really Does
The greatest common divisor (GCD) is the largest number that divides two integers exactly; the least common multiple (LCM) is the smallest number they both divide into. This calculator runs the Euclidean algorithm for the GCD — showing each remainder step — and applies the identity GCD × LCM = a × b for the LCM.
The Euclidean algorithm is one of the oldest efficient procedures in mathematics, and it is still the right one: instead of factoring, it replaces the pair (a, b) with (b, a mod b) until the remainder hits zero. Three or four steps solve numbers whose prime factorization would take a page.
Everything runs locally in your browser: no numbers stored, nothing tracked, offline after the first visit.
Quick answer: gcd(48, 180) = 12 (remainders 36 → 12 → 0), and lcm(48, 180) = 48 × 180 ÷ 12 = 720.
The Method, Explained Plainly
Euclidean algorithm: repeatedly replace (a, b) with (b, a mod b) until b = 0; the last nonzero a is the GCD.
LCM identity: LCM(a, b) = (a × b) ÷ GCD(a, b)
- Why it works — every common divisor of a and b also divides a mod b, so the GCD is preserved by each replacement step.
- Why the identity holds — a × b counts the shared prime factors (GCD) twice and the unshared ones once; dividing by GCD leaves exactly the LCM.
For more than two numbers, fold pairwise: gcd(gcd(a, b), c), lcm(lcm(a, b), c).
How to Use It — In Order
- Enter two positive integers — order does not matter; the algorithm is symmetric in effect.
- Read the GCD — with the full remainder chain shown for verification.
- Read the LCM — computed via the identity, no factoring needed.
- Add more numbers — for several, the tool folds pairwise; check the running GCD only shrinks and the LCM only grows.
- Use it on fractions — GCD reduces a fraction to lowest terms; LCM is the common denominator for adding them.
- Sanity-check — the GCD must divide both inputs exactly; a quick division confirms it.
Worked Example, Verified by Hand
GCD(48, 180) by the Euclidean algorithm:
- 180 mod 48 = 36 (48 × 3 = 144, remainder 36).
- 48 mod 36 = 12.
- 36 mod 12 = 0 → stop. Last nonzero value: GCD = 12.
- LCM = 48 × 180 ÷ 12 = 8,640 ÷ 12 = 720.
Checks: 12 divides both (48 ÷ 12 = 4; 180 ÷ 12 = 15) ✓. 720 is a multiple of both (720 ÷ 48 = 15; 720 ÷ 180 = 4) ✓. Fraction reduction in action: 48/180 = 4/15 after dividing by the GCD.
Common Mistakes to Avoid
- Factoring instead of using the algorithm — the Euclidean method is faster and never needs prime factorizations.
- Stopping one step early — the GCD is the last nonzero remainder, not the zero one.
- Applying LCM = a × b without dividing by the GCD — that product is a common multiple, rarely the least one.
- Non-integers or negatives — GCD/LCM are defined for positive integers; reduce fractions first, take absolute values for signs.
- Pairwise folding mistakes on three-plus numbers — gcd(gcd(a,b),c) is the order; batching all at once is not the algorithm.
Limitations
- Positive integers only — fractions, decimals and polynomials need adapted algorithms.
- JavaScript precision caps inputs near 2⁵³; beyond that, use big-integer tooling.
- Does not output the prime factorization — the prime-factorization tool covers that view.
Expected Accuracy
Integer-exact arithmetic — modulo and multiplication carry no rounding. Results are exact up to the precision limit of the platform's integers.
Privacy — Your Data Never Leaves This Device
Everything is computed locally: no inputs stored or sent, no tracking — the tool works offline too.
Related Tools & Guides
Natural next steps from GCD & LCM:
- All Utilities Calculators
- Ratio Simplifier — GCD applied to ratios
- Fraction Calculator — GCD reduces, LCM adds
- Prime Factorization — the alternative route to both
- Percentage Calculator
Sources & Standards
The Euclidean algorithm appears in Euclid's Elements (Book VII) and is unchanged in modern number theory.
- Wolfram MathWorld — Euclidean Algorithm (reference)
Bottom Line
Remainders down to zero give the GCD; one multiplication and division gives the LCM. Two thousand years old and still the fastest way.
Frequently Asked Questions
How do I calculate the GCD of two numbers?
Run the Euclidean algorithm: repeatedly replace the pair with (smaller, remainder of larger ÷ smaller) until the remainder is zero. For 48 and 180: remainders 36, 12, 0 → GCD 12.
How do I find the LCM?
LCM(a, b) = a × b ÷ GCD(a, b). For 48 and 180: 8,640 ÷ 12 = 720.
Why does the Euclidean algorithm work?
Any common divisor of a and b also divides a mod b, so each step preserves the greatest common divisor while shrinking the numbers — until the GCD is the last nonzero remainder.
What is the GCD used for?
Reducing fractions to lowest terms (48/180 → 4/15), simplifying ratios, and solving Diophantine problems — anywhere a shared divisor matters.
How do I find the GCD of three numbers?
Fold pairwise: gcd(gcd(a, b), c). The LCM folds the same way: lcm(lcm(a, b), c).
What is the relation between GCD and LCM?
For positive integers, GCD(a, b) × LCM(a, b) = a × b — the product counts shared factors twice, and dividing by the GCD leaves the least common multiple.
Is this calculator free and private?
Yes — it runs entirely in your browser with no sign-up, no upload and no tracking.
What does gcd & lcm calculator compute?
Use GCD & LCM Calculator when the figure needs to be right the first time: it evaluates your inputs against the standard Utilities method and shows the working, not just the answer. Because the Utilities convention is named on the page, GCD & LCM Calculator settles arguments about which method produced the output.
Which method produces the gcd?
The first steps are gcd(12,18) via euclidean algorithm = 6, then lcm = 12×18 / 6 = 36. GCD & LCM Calculator prints the formula before the answer, so the gcd can be reconstructed by hand from the First Number and Second Number if you want to check it independently.
What inputs does the GCD & LCM Calculator ask for?
GCD & LCM Calculator needs no setup: no account, no upload.
How sensitive is the result to the First Number?
At the defaults GCD & LCM Calculator returns GCD: 6 | LCM: 36; doubling First Number to 24 moves it to GCD: 6 | LCM: 72.
How should the result from the GCD & LCM Calculator be read?
The main number the gcd & lcm calculator returns is the gcd for your exact inputs. Fees, taxes, rounding conventions and local rules sit outside the gcd & lcm model, so the gcd inherits whatever they would have changed.
What is the page best used for?
Typical moments for the gcd & lcm page: holding a figure for later review, trying the same numbers twice, and spot-checking a quoted figure, or a quick check before a figure goes into a document. Two runs on GCD & LCM Calculator — one at the low end of a plausible First Number and Second Number, one at the high end — say more about risk than a single precise figure.
Bill Split & Tip and other Utilities tools
Bill Split & Tip · Biweekly Pay Calculator · Dice Roll Simulator · QR Version Finder · Hash Generator · Area Calculator · Utilities Guides