GCD and LCM Calculator
NEWGCD and LCM calculator for two or more integers of any size, with every step of the Euclidean algorithm shown. Free, instant and runs in your browser.
Runs 100% in your browser — your input is never uploaded or stored on our servers.
Separate numbers with commas, spaces or new lines. Negative numbers and very large integers are fine.
- Bézout identity: 48 × (-1) + 18 × (3) = 6
Euclidean algorithm steps
gcd(48, 18) = 6
- 48 = 2 × 18 + 12
- 18 = 1 × 12 + 6
- 12 = 2 × 6 + 0
lcm(48, 18) = 48 × 18 ÷ 6 = 144
Quick Examples
Typical inputs and the results this tool produces.
Overview
The greatest common divisor (GCD, also called HCF) is the largest number that divides all your inputs, and the least common multiple (LCM) is the smallest number they all divide into. This GCD and LCM calculator finds both for two or more integers at once.
You need the GCD to simplify fractions and ratios, and the LCM to add fractions with different denominators or to work out when repeating schedules line up. The tool lists every step of the Euclidean algorithm, a = q × b + r, so you can follow it or copy it into homework, and for two numbers it also gives the Bézout coefficients.
Inputs can be negative or hundreds of digits long because the math uses exact big integers, entirely in your browser.
Why use this tool?
- GCD and LCM of any count of integers
- Every Euclidean algorithm step written out
- Exact for huge numbers, no rounding
- Spots coprime numbers automatically
- Works offline in your browser
Features
Many numbers
Enter up to 50 integers separated by commas, spaces or new lines.
Euclid steps
Each division a = q × b + r is listed until the remainder reaches 0.
LCM formula
Shows lcm(a, b) = a × b ÷ gcd(a, b) for every stage.
Big integers
Exact BigInt arithmetic for values up to 400 digits each.
Bézout identity
For two numbers, finds x and y with a·x + b·y = gcd(a, b).
Copy results
Copy the GCD or LCM with one click.
How to Use
Enter integers
Type two or more whole numbers, separated by commas or spaces.
Read GCD and LCM
Both results appear immediately in the blue panels.
Follow the steps
Check the Euclidean algorithm steps and the LCM formula below.
Copy
Press Copy under the value you need.