GCD / LCM

Use this calculator

The greatest common divisor (GCD) is the largest positive integer dividing all entered numbers; the least common multiple (LCM) is their smallest non-negative common multiple under the app’s zero-handling convention. Factor analysis describes each integer as a product of prime factors.

Two different integer relationships

lcm(a,b) = \frac{|ab|}{\gcd(a,b)}\quad(a,b \neq 0)
\gcd(a,b) = gcd(b,a\ mod\ b)

a and b are integers; gcd is the greatest common divisor, lcm the least common multiple, |ab| the absolute product, and mod the remainder. These identities explain the app’s exact integer computations.

Enter a list or analyse its factors

In GCD / LCM mode, fill Whole numbers with at least two integers separated by commas, spaces, or semicolons. The Factor analysis mode accepts one through eight non-zero integers with absolute values at most one trillion.

Reading the exact integer results

GCD / LCM returns the GCD first and LCM beneath it using BigInt arithmetic, including inputs with zero. Factor analysis lists each value with its prime-power decomposition and a value count; that mode uses an explicit size limit.

Packing versus repeating

A GCD can identify the largest equally sized pieces cut from lengths 24 and 36 (piece size 12). An LCM identifies the first common repeat for events every 24 and 36 units (72).

Shared divisors culminate at the GCD, 12

A GCD can identify the largest equally sized pieces cut from lengths 24 and 36 (piece size 12). An LCM identifies the first common repeat for events every 24 and 36 units (72).

Euclid’s shortcut

The remainder sequence 36 = 1×24 + 12 and 24 = 2×12 + 0 ends at 12, the GCD. Pairwise reduction extends the procedure to more than two numbers.

The last nonzero remainder identifies the GCD

The remainder sequence 36 = 1×24 + 12 and 24 = 2×12 + 0 ends at 12, the GCD. Pairwise reduction extends the procedure to more than two numbers.

Prime exponents

For 24 = 2³×3 and 36 = 2²×3², the GCD uses the smaller exponent of each common prime; the LCM uses the larger. This provides an independent check.

Take minima for GCD and maxima for LCM

For 24 = 2³×3 and 36 = 2²×3², the GCD uses the smaller exponent of each common prime; the LCM uses the larger. This provides an independent check.

Quick answers

Can I enter three numbers?

Yes; GCD / LCM reduces a list pairwise.

Which mode shows prime powers?

Factor analysis reports decompositions such as 2³ × 3.

Why do zeros need care?

The app handles zero in GCD / LCM with an LCM of zero, while Factor analysis requires non-zero integers.