Toolbox

A formula sheet plus reference tools for calculator, equation solver, units, elements, graphs and molecules.

Toolbox · GCD & LCM

GCD & LCM

Greatest common divisor and least common multiple of several integers, with prime factorization steps

3 / 6

Enter 2–6 non-zero integers; add or remove any time

Examples
GCD6
LCM72
Steps
8 / 8
  1. 1Given
    12, 18, 24

    3 numbers — factor each one first

  2. 2Factorize
    12=2²×3

    Divide by primes in turn: 12 ÷ 2 = 6, 6 ÷ 2 = 3, 3 ÷ 3 = 1

  3. 3Factorize
    18=2×3²

    Divide by primes in turn: 18 ÷ 2 = 9, 9 ÷ 3 = 3, 3 ÷ 3 = 1

  4. 4Factorize
    24=2³×3

    Divide by primes in turn: 24 ÷ 2 = 12, 12 ÷ 2 = 6, 6 ÷ 2 = 3, 3 ÷ 3 = 1

  5. 5GCD
    gcd(12, 18, 24)=2×3=6

    Shared primes at their lowest powers multiply to 6

  6. 6LCM
    lcm(12, 18, 24)=2³×3²=72

    Every prime at its highest power multiplies to the LCM

  7. 7Check
    72 ÷ 12 = 6, 72 ÷ 18 = 4, 72 ÷ 24 = 3

    The LCM is divisible by every number, so it is a common multiple

  8. 8Result
    gcd = 6, lcm = 72

    GCD 6, LCM 72

Factor every number: the GCD takes each shared prime at its lowest power, the LCM takes every prime at its highest power. Each integer may be up to 1000000.

AI DO LEARN

Science, made explorable.

5 Disciplines·6 Levels·647 Knowledge points

© 2026 AI DO LEARN. All rights reserved.

Original explanations, diagrams and code may not be republished without permission; please credit the source when quoting.