Life Calculator
MAKE THE FORMULA CLEAR

Greatest common divisor and least common multiple

Find the largest integer dividing both numbers and the smallest positive multiple shared by them. These answer different grouping and cycle questions.

Start with your own numbers

Editable example

An example is filled in. Replace it with your own data to calculate.

Enter two positive integers to explore equal grouping or when repeating cycles meet again.

Enter first positive integer, for example 12. Use the displayed unit; replace the example with your own value.
Enter second positive integer, for example 18. Use the displayed unit; replace the example with your own value.

Results update when inputs are complete. A plan is kept only when you save it. Inputs and results are not uploaded.

Saved plans →

Saved in this browser. Before changing devices, export a backup from My tools.

Example result

Greatest common divisor

6

A common divisor divides both numbers; a common multiple is divisible by both numbers.

Least common multiple36
Integer ratio in lowest terms2:3

Worked steps

  1. 12 ÷ 18 = 0, remainder 12
  2. 18 ÷ 12 = 1, remainder 6
  3. 12 ÷ 6 = 2, remainder 0
  4. The last nonzero divisor is 6; least common multiple = 12 ÷ 6 × 18 = 36

Enter two positive integers from 1 to 1000000. Uses Euclid's algorithm for GCD; LCM = first number ÷ GCD × second number. Zero, negatives, decimals and more than two numbers are unsupported. Convert recurring-event periods to the same unit first and assume both begin at the same time.

Method and scope

The greatest common divisor uses the Euclidean algorithm. The least common multiple equals the first number divided by the GCD, times the second number.

GCD can describe the size of equal groups with no remainder. LCM can describe a shared repeat period only when both cycles use the same unit and start together.

Enter two positive integers from 1 to 1,000,000. Zero, negatives, decimals and lists of three or more numbers are outside scope.

References:National Taiwan Normal University number theory notes: GCD and LCM

What this helps you do

Find the largest integer dividing both numbers and the smallest positive multiple shared by them. These answer different grouping and cycle questions.

What to enter

Start with first positive integer, then fill the other relevant fields in the units shown. The field hints explain the required format and examples.

How the calculation works

The greatest common divisor uses the Euclidean algorithm. The least common multiple equals the first number divided by the GCD, times the second number.

Worked example

For 12 and 18, the GCD is 6 and the LCM is 36. Two cycles starting together and repeating every 12 and 18 minutes next coincide after 36 minutes.

Understanding the answer

GCD can describe the size of equal groups with no remainder. LCM can describe a shared repeat period only when both cycles use the same unit and start together.

Scope and limitations

Enter two positive integers from 1 to 1,000,000. Zero, negatives, decimals and lists of three or more numbers are outside scope.

Keep it handy for next time

Add Greatest common divisor and least common multiple to your home screen

This icon opens this tool. Confirm installation in your browser.

  1. iPhone: Open in Safari, tap Share → Add to Home Screen, then confirm.
  2. Android: Open in Chrome and choose Install app or Add to Home screen from the menu.
  3. In an in-app browser such as LINE or Facebook, use its menu to open the page in Safari or Chrome first.

Browser options vary. A shortcut does not provide cross-device synchronization, and an installed app may have separate storage. Export a backup from My tools first. The first load requires a connection.

Checking offline data.