Hoglet

GCD and LCM calculator

Two or more whole numbers, parted by commas or spaces.

2 numbers: 84, 60

GCD

LCM

  1. 84 = 1 × 60 + 24
  2. 60 = 2 × 24 + 12
  3. 24 = 2 × 12 + 0

Nothing left over: the GCD is 12

LCM = 84 × 60 ÷ 12 = 420

GCD of 84, 60 = 12; LCM = 420

GCD and LCM Calculator: Euclid’s Steps and Prime Factors

Greatest common divisor and least common multiple, with steps.

Type two or more whole numbers, parted by commas or spaces (up to 50 of them, of any size). The greatest common divisor (GCD, also called the greatest common factor or highest common factor) is the largest number that divides all of them; the least common multiple (LCM) is the smallest number all of them divide. Both are shown large, and the working two ways. Euclid’s divisions: the larger number is divided by the smaller, then the smaller by what is left over, until nothing is; the last number divided by is the GCD, and the LCM is a × b ÷ GCD. Prime factors: each number written as a product of primes; the GCD takes each prime the smallest number of times it appears in any of them, the LCM the largest. With more than two numbers, they are taken two at a time. Prime factors are shown for numbers up to a thousand million million (10¹⁵). A minus sign is ignored, since −12 and 12 have the same divisors.

How to use GCD and LCM calculator

  1. Type two or more whole numbers in Numbers, parted by commas or spaces.
  2. Read the GCD and the LCM, shown large.
  3. Under Working, choose Euclid’s divisions or Prime factors to see the steps.

GCD and LCM calculator: common questions

How do you find the greatest common divisor of two numbers?

By Euclid’s divisions: divide the larger number by the smaller and keep the remainder, then divide the smaller by that remainder, and so on. When nothing is left over, the last number divided by is the greatest common divisor (GCD, also GCF or HCF).

How do you calculate the least common multiple?

The least common multiple of two numbers is a × b ÷ their greatest common divisor. By prime factors, the LCM takes every prime the most times it appears in any of the numbers, and the GCD each shared prime the fewest times.

How do you find the GCD and LCM of three or more numbers?

Take them two at a time: gcd(a, b, c) = gcd(gcd(a, b), c), and the same for the LCM. The GCD and LCM calculator takes up to 50 whole numbers; a minus sign is ignored, and a list with 0 in it has 0 as its least common multiple.

Everything stays on your device. Nothing is uploaded. Works offline once your first visit has stored the app.