⚡
usefultools.dev
GCD

GCD and LCM Calculator

NEW

GCD 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.

GCD (greatest common divisor)
6
LCM (least common multiple)
144
  • Bézout identity: 48 × (-1) + 18 × (3) = 6

Euclidean algorithm steps

gcd(48, 18) = 6

  1. 48 = 2 × 18 + 12
  2. 18 = 1 × 12 + 6
  3. 12 = 2 × 6 + 0

lcm(48, 18) = 48 × 18 ÷ 6 = 144

⚡

Quick Examples

Typical inputs and the results this tool produces.

Two numbers
48, 18
GCD 6 · LCM 144
Three numbers
12, 18, 30
GCD 6 · LCM 180
Euclid
1071, 462
GCD 21 · LCM 23562
Coprime
17, 31
GCD 1 · LCM 527 (coprime)
Four numbers
4, 6, 8, 10
GCD 2 · LCM 120
📖

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

1

Enter integers

Type two or more whole numbers, separated by commas or spaces.

2

Read GCD and LCM

Both results appear immediately in the blue panels.

3

Follow the steps

Check the Euclidean algorithm steps and the LCM formula below.

4

Copy

Press Copy under the value you need.

🤔

Frequently Asked Questions