ToolPatch

One page. One job. Done.

← Back to all tools
Science & Math Math calculation

GCD LCM Calculator

Find greatest common divisor and least common multiple for two integers.

Science & Math

GCD LCM Calculator computes the greatest common divisor and least common multiple for two integers. Use it to simplify fractions, align cycles, find common denominators, or check divisibility relationships.

Permalink

Input guidance

Enter the first integer.

How to use this tool

  1. Enter the first integer.
  2. Enter the second integer.
  3. Review the GCD and LCM with the original pair.

GCD and LCM Inputs

Results

GCD: 6

LCM: 144

Coprime: No

Greatest Common Divisors and Least Common Multiples

Divisibility as Structure

The greatest common divisor, or GCD, is the largest positive integer that divides two or more integers without remainder. The least common multiple, or LCM, is the smallest positive integer that each of the numbers divides. Together they describe how whole numbers share factors and align on repeated cycles.

For example, the GCD of 18 and 24 is 6 because 6 is the largest factor common to both. The LCM is 72 because 72 is the first positive number that is a multiple of both. One concept looks downward toward shared factors; the other looks upward toward shared repetitions.

Prime Factorization

Prime factorization makes the relationship clear. Break each number into primes, then compare powers of each prime. The GCD uses the minimum shared powers; the LCM uses the maximum powers needed to cover all numbers. For 18 = 2 x 3^2 and 24 = 2^3 x 3, the GCD is 2 x 3 = 6 and the LCM is 2^3 x 3^2 = 72.

This method is intuitive, but factoring large numbers can be expensive. For everyday arithmetic it is fine. For large integers, algorithms such as Euclid's method are more efficient for finding the GCD.

Euclid’s Algorithm

Euclid's algorithm finds the GCD by repeated division with remainder. The central fact is that gcd(a, b) equals gcd(b, a mod b). Repeating this step shrinks the numbers until the remainder is zero; the last nonzero remainder is the GCD.

This algorithm is ancient, fast, and foundational. It appears in fraction simplification, modular arithmetic, cryptography, computer algebra, and number theory. It works because subtracting or removing whole multiples of one number from another does not change their common divisors.

Where GCD and LCM Appear

GCD is used to reduce fractions, find common units, simplify ratios, and reason about divisibility. LCM is used to add fractions with different denominators, schedule repeating events, align cycles, and solve modular timing problems.

The two are connected by the identity gcd(a, b) x lcm(a, b) = |a x b| for positive integers. That relationship shows they are not separate tricks; they are complementary views of the same factor structure.

Formula or method

How to interpret the result

Confidence and limitations

Related tools and workflows

Related science and math tools help test nearby formulas, assumptions, inputs, or statistical checks in the same analysis. Start with Flywheel Energy Calculator, Arithmetic Sequence Solver, and Blackbody Radiation Calculator when you need a quick follow-up check.