← All Tools

GCD LCM Calculator🔒 100% local

Greatest common divisor/least common multiple. Privacy-first, no server uploads, no tracking.

Related Tools

Bmi CalculatorCron CalculatorCron Time Predictor

Takes two or more integers separated by commas or spaces and prints their greatest common divisor and least common multiple. It also factorises every input and both results into primes, then compares GCD x LCM with the product of the inputs as a check. Euclid's algorithm and the trial-division factorisation run in the page's own JavaScript.

How to use it

  1. Type the integers, for example 12, 18 or 8 12 20.
  2. Press Process.
  3. Read GCD and LCM on the top lines, then use the factorisations underneath to see why those values came out as they did.

Worked example

12, 18becomesInput: 12, 18 GCD: 6 LCM: 36 Verification: 12 = 2 × 2 × 3 18 = 2 × 3 × 3 GCD factorization: 2 × 3 LCM factorization: 2 × 2 × 3 × 3 Check: GCD × LCM = 6 × 36 = 216 Product of inputs = 216 ✓ (matches: GCD × LCM = a × b for 2 numbers)
8, 12, 20becomesInput: 8, 12, 20 GCD: 4 LCM: 120 Verification: 8 = 2 × 2 × 2 12 = 2 × 2 × 3 20 = 2 × 2 × 5 GCD factorization: 2 × 2 LCM factorization: 2 × 2 × 2 × 3 × 5 Check: GCD × LCM = 4 × 120 = 480 Product of inputs = 1920

The checkmark line only appears when exactly two numbers are given, because the identity GCD x LCM = a x b does not hold for three inputs.

When to use it

What it does not do