Toolbox
A formula sheet plus reference tools for calculator, equation solver, units, elements, graphs and molecules.
GCD & LCM
Greatest common divisor and least common multiple of several integers, with prime factorization steps
Enter 2–6 non-zero integers; add or remove any time
- 1Given12, 18, 24
3 numbers — factor each one first
- 2Factorize12=2²×3
Divide by primes in turn: 12 ÷ 2 = 6, 6 ÷ 2 = 3, 3 ÷ 3 = 1
- 3Factorize18=2×3²
Divide by primes in turn: 18 ÷ 2 = 9, 9 ÷ 3 = 3, 3 ÷ 3 = 1
- 4Factorize24=2³×3
Divide by primes in turn: 24 ÷ 2 = 12, 12 ÷ 2 = 6, 6 ÷ 2 = 3, 3 ÷ 3 = 1
- 5GCDgcd(12, 18, 24)=2×3=6
Shared primes at their lowest powers multiply to 6
- 6LCMlcm(12, 18, 24)=2³×3²=72
Every prime at its highest power multiplies to the LCM
- 7Check72 ÷ 12 = 6, 72 ÷ 18 = 4, 72 ÷ 24 = 3
The LCM is divisible by every number, so it is a common multiple
- 8Resultgcd = 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.
