Skip to calculator
Veomark

Free · Instant · No signup

Greatest Common Divisor (GCD) & Least Common Multiple (LCM) Calculator

Euclidean GCD and LCM = |A x B| / GCD for two integers.

Page updated 2026-09-04.

Greatest Common Divisor (GCD) & Least Common Multiple (LCM) Calculator visual
Sponsored

Calculator

Default 48.

Default 18.

Calculated Results

GCD

--

LCM

--

Sponsored

Two related but different numbers from the same pair

48 and 18 have a greatest common divisor (GCD) of 6 and a least common multiple (LCM) of 144 -- the largest number that divides both evenly, and the smallest number both divide into evenly, respectively.

GCD and LCM are connected by a clean identity: GCD x LCM = A x B, which you can verify here: 6 x 144 = 864, and 48 x 18 = 864 -- the same result either way, which is a useful sanity check whenever you calculate both values for the same pair of numbers.

48 = 6 x 8 and 18 = 6 x 3 shows the GCD (6) is the shared factor between the two numbers, while 144 = 48 x 3 = 18 x 8 shows the LCM as the smallest shared multiple -- both figures come directly from the two numbers' prime factorizations (48 = 2⁴ x 3, 18 = 2 x 3²).

A special case worth knowing about zero

LCM of 0 and n is 0. Inputs are rounded to integers. If either input is 0, the LCM is defined as 0 -- since 0 is a multiple of every number (0 x anything = 0), the 'smallest common multiple' involving 0 is trivially 0 itself, a special case worth knowing since it doesn't follow the same intuitive pattern as LCM calculations between two positive numbers.

Non-integer inputs are rounded to the nearest whole number before the calculation runs, since GCD and LCM are only defined for integers -- a fractional input like 48.6 would be rounded to 49 before finding its GCD and LCM with the other number.

GCD is commonly used to simplify fractions (dividing numerator and denominator by their GCD), while LCM is commonly used to find a common denominator when adding or comparing fractions with different denominators -- two genuinely different practical applications of the same pair of related calculations.

Related number-theory and fraction tools

For applying the GCD concept directly to simplify a ratio into its lowest terms, the Ratio/Fraction Simplifier Calculator performs exactly that calculation.

Frequently Asked Questions (FAQ)

How is the GCD of 48 and 18 calculated as 6?

6 is the largest number that divides evenly into both 48 (48/6 = 8) and 18 (18/6 = 3). Looking at prime factorizations confirms this: 48 = 2⁴ x 3 and 18 = 2 x 3², sharing a factor of 2 x 3 = 6.

How is the LCM of 48 and 18 calculated as 144?

144 is the smallest number that both 48 and 18 divide into evenly (144/48 = 3, 144/18 = 8). It can also be derived from the GCD identity: LCM = (A x B) / GCD = (48 x 18) / 6 = 864 / 6 = 144.

What happens if I enter 0 as one of the numbers?

LCM of 0 and n is 0. Inputs are rounded to integers. LCM is defined as 0 in that case, since 0 is technically a multiple of every number. This is a special-case rule worth knowing, since it doesn't follow the intuitive pattern of LCM between two positive numbers.

Does this work with decimal inputs?

LCM of 0 and n is 0. Inputs are rounded to integers. Not directly -- decimal inputs are rounded to the nearest whole number before calculating, since GCD and LCM are only mathematically defined for integers.

When would I actually need LCM instead of GCD in practice?

LCM is most commonly needed when adding or comparing fractions with different denominators (finding a common denominator), while GCD is most commonly used to simplify a fraction or ratio down to its lowest terms -- different practical problems, related by the same underlying number theory.