Maths & numbers

GCD & LCM calculator

Find the greatest common divisor and least common multiple.

GCD & LCM calculator
Esc to restore

Your inputs

Results update as you type. Larger files run when you press Update result.

Your result

LOCAL & PRIVATE

Your result will appear here.

Your inputs stay in this browser. Nothing is uploaded or saved.

A clear answer. Here’s how.

Uses Euclid’s algorithm with exact integers. GCD(0,0) is shown as zero by convention; the LCM is zero if either number is zero. Negative inputs use their absolute values.

See a worked example

Worked example

A fixed demonstration, separate from the values you enter above.

First whole number
24
Second whole number
36

Example result

Greatest common divisor
12
Least common multiple
72