ToollyX
no sign-up ยท instant ยท free

LCM & GCD Calculator

Find the LCM and GCD of up to 6 numbers with prime factorization, walk through the full Euclidean algorithm step by step, or find the least common denominator for a set of fractions.

TypeNumber Theory
NumbersUp to 6
PrecisionUnlimited Size
IncludesEuclid ยท LCD
728 ร— 90 โ€” Leaderboard Ad
๐Ÿ”ฃLCM & GCD Calculator
Number 1
Number 2
TRY:
GCD ยท LCM
6 ยท 36
GCD (Greatest Common Divisor)
6
LCM (Least Common Multiple)
36
Verified: GCD ร— LCM = 6 ร— 36 = 216 = 12 ร— 18 = 216
112 = 2^2 ร— 3
218 = 2 ร— 3^2
1218โ€”2, 3โ€”shared primes โ†’ GCD ยท all primes โ†’ LCM
โš™๏ธSettings
Show Prime Factorization
Break each number into its prime factors in LCM & GCD mode
Show Shared-Factors Diagram
Draw a Venn diagram of shared vs. unique primes for two numbers
Show Verification Check
Confirm GCD ร— LCM = a ร— b for two-number results
๐Ÿ“‹Formula Reference
Euclidean Algorithm
GCD(a,b) = GCD(b, a mod b)
LCM from GCD
LCM(a,b) = |a ร— b| / GCD(a,b)
Verification
GCD ร— LCM = a ร— b
Many numbers
GCD(a,b,c) = GCD(GCD(a,b),c)
GCD from primes
Lowest power of shared primes
LCM from primes
Highest power of every prime
Coprime
GCD(a,b) = 1
LCD of fractions
LCM of the denominators
728 ร— 90 โ€” Leaderboard Ad

โšก Quick Tips for Working With LCM and GCD

01Reach for LCD of Fractions mode directly when adding fractions. It skips the middle step of finding the LCM of the denominators yourself and rewrites every fraction for you in one pass.
02A coprime result doesn't mean either number is prime. 8 and 15 are coprime despite both being composite โ€” coprime only means they share no common factor with each other.
03Use Euclidean Steps mode to check homework, not just the final answer. A wrong final GCD is easy to spot; a mistake in the third division step of a five-step process is not, until you see the whole trace.
04For more than two numbers, GCD and LCM are computed pairwise, not all at once. GCD(a,b,c) is really GCD(GCD(a,b),c) โ€” worth knowing if you're checking the result against a formula in a textbook.

Features

๐Ÿ”ฃUp to 6 Numbers at Once

GCD and LCM across 2 to 6 whole numbers, computed pairwise and shown together.

โ™พ๏ธUnlimited Precision

Built on BigInt arithmetic โ€” exact results regardless of how many digits the numbers have.

โž—Full Euclidean Algorithm Trace

Every division step shown individually, not just the final GCD value.

ยฝLCD Finder for Fractions

Rewrites 2 to 4 fractions over their least common denominator and adds them automatically.

๐Ÿ”ตShared-Factors Venn Diagram

Visualizes exactly which prime factors two numbers share and which are unique to each.

โœ“Built-In Verification

Confirms GCD ร— LCM = a ร— b automatically for every two-number result.

Why Unlimited Precision Actually Matters Here

Most free LCM and GCD calculators are built on ordinary JavaScript numbers, which stop being exact integers above 9,007,199,254,740,991 โ€” a limit that sounds enormous until a computation actually multiplies two large numbers together, which is precisely what finding an LCM does. Past that point, a calculator built on ordinary numbers can return a confidently wrong answer with no warning at all. This tool computes every GCD and LCM using BigInt arithmetic instead, which has no upper limit โ€” a 30-digit number is handled exactly as precisely as a 3-digit one.

Prime factorization is the one piece that's still capped, and for a different reason: finding the prime factors of a huge number by trial division genuinely gets slow, regardless of number type, once the number climbs past about a trillion. When that happens, this tool skips the factorization display and says so plainly, while the GCD and LCM above it remain exact โ€” an honest limitation on a display feature, not a silent accuracy problem in the actual math.

Large-number GCD computation isn't just an academic edge case, either. RSA encryption โ€” the algorithm behind a large share of secure web traffic โ€” generates key pairs by working with integers hundreds of digits long, and the Euclidean algorithm is exactly what makes computing a GCD between numbers that size practical in the first place, finishing in a bounded number of steps rather than scaling with how large the inputs are. This tool won't generate cryptographic keys, but it uses precisely the same underlying algorithm, at a scale anyone can verify by hand-checking a much smaller example first.

Why the Euclidean Algorithm Gets Its Own Dedicated View

Finding GCD(48, 18) as "6" tells you the answer but hides the actual arithmetic: 48 = 18ร—2 + 12, then 18 = 12ร—1 + 6, then 12 = 6ร—2 + 0 โ€” three steps, each one dividing the previous divisor by the previous remainder, stopping the moment a remainder of zero appears. Euclidean Steps mode shows exactly that trace for any two numbers, which is the difference between checking a final answer and actually verifying the arithmetic that produced it โ€” genuinely useful for anyone learning the algorithm rather than just needing the result.

GCD Is the Same Math Behind Simplifying a Ratio

Reducing a ratio to its lowest terms is the exact same operation as simplifying a fraction: divide every term by their greatest common divisor. A ratio of 18:24 shares a GCD of 6 with itself split across two terms, so it reduces to 3:4 โ€” precisely the calculation this tool performs when comparing two numbers. The Ratio Calculator applies that same GCD reduction automatically whenever a ratio needs simplifying, so switching between "what's the GCD of these two numbers" and "what's this ratio in its simplest form" is really the same question asked two different ways.

728 ร— 90 โ€” Leaderboard Ad

Who Actually Reaches for an LCM & GCD Calculator

Students checking number theory and fraction homework across all three modes, not just the basic two-number case most lessons start with. Anyone adding or comparing fractions with different denominators โ€” a recipe scaled by thirds and quarters, a construction measurement in eighths and sixteenths โ€” using LCD of Fractions mode to skip the manual denominator-matching step entirely. Scheduling and manufacturing planners figuring out when two repeating cycles next align, like maintenance intervals or production batch sizes, which is exactly what LCM answers. Anyone verifying a fraction is already fully reduced, since a GCD of 1 between numerator and denominator confirms it directly. For simplifying a specific fraction rather than finding a shared denominator across several, the Fraction Calculator applies the same GCD logic automatically.

Two Calculations Worth Walking Through

Tiling a floor without cutting: a room measures 360 cm by 480 cm, and the largest square tile that fits both dimensions with no cutting is exactly GCD(360, 480) = 120 cm. Anything larger leaves a gap along one wall; anything smaller wastes tiles unnecessarily. The same GCD logic sizes the largest equal teams from a group, or the coarsest shared unit between any two measurements.

Adding three fractions with different denominators: 1/4 + 1/6 + 1/3 needs a shared denominator before the numerators can be added at all. LCD of Fractions mode finds LCD(4, 6, 3) = 12, rewrites the three fractions as 3/12, 2/12 and 4/12, and adds them to 9/12 โ€” which it then simplifies to 3/4 automatically, using the exact same GCD step that reduces any fraction to lowest terms. Doing this by hand usually means guessing a common denominator, checking it actually works for every fraction involved, and only then adding โ€” skipping straight to the true LCD removes all of that trial and error.

Why Browser-Based Beats Long Division on Paper

Working the Euclidean algorithm by hand for two large numbers means several rounds of long division, each one a fresh opportunity for an arithmetic slip that invalidates every step after it. This tool runs the entire trace, the factorization, and the LCD workflow entirely client-side in JavaScript, with nothing entered ever transmitted to a server โ€” safe for coursework or figures you'd rather keep private. For arithmetic that isn't specifically about LCM or GCD โ€” general expression evaluation, trig, logs โ€” the Scientific Calculator handles that directly.

Where This Calculator Draws the Line

It finds LCM, GCD and least common denominators for whole numbers and fractions โ€” it doesn't extend to polynomial GCD, modular inverses, or the extended Euclidean algorithm's Bรฉzout coefficients, which belong to more specialized abstract algebra and cryptography tooling. To check whether an individual number is prime, or to see its full factor list on its own, the Prime Checker is the more direct tool for that one question.

Frequently Asked Questions

728 ร— 90 โ€” Leaderboard Ad