Tooleem
CalculatorsThis tool runs in your browser. No files or text are sent to our servers.

GCD and LCM Calculator

Find the GCD (Greatest Common Divisor) and LCM (Least Common Multiple) of two or more numbers. Add rows for more than two numbers. Runs in your browser.

GCD (Greatest Common Divisor)6
LCM (Least Common Multiple)36
Share toolWhatsApp

A free GCD and LCM calculator that finds the Least Common Multiple (LCM) and Greatest Common Divisor (GCD, also called GCF) of two or more whole numbers. Enter the numbers, add a row if you need more than two, and the tool immediately shows the GCD and LCM. Useful for students working through math homework, or anyone who needs to simplify a fraction or find a common denominator quickly. Everything runs in your browser, and nothing is stored.

01

How to use this tool

  1. 01Enter the numbersType at least two positive whole numbers. Add a row if you want to calculate for three or more numbers.
  2. 02Read the GCD and LCMThe GCD and LCM update automatically as you type.
02

When is this useful?

  • Checking math homeworkQuickly compute the GCD and LCM for elementary and middle-school math problems.
  • Simplifying a fractionUse the GCD of the numerator and denominator to reduce a fraction to its simplest form.
  • Finding a common denominatorUse the LCM of several denominators to find a common denominator before adding or subtracting fractions.
03

Examples

  • GCD and LCM of 12 and 18GCD(12, 18) = 6, LCM(12, 18) = 36.
  • Coprime numbersGCD(7, 9) = 1 (no common factor besides 1), LCM(7, 9) = 63 (their product).
  • Three numbers at onceGCD(4, 6, 8) = 2, LCM(4, 6, 8) = 24.
04

Formula and how the calculation works

The GCD is computed with the Euclidean algorithm: GCD(a, b) = GCD(b, a mod b), repeated until the remainder is 0. The LCM is derived from the GCD: LCM(a, b) = (a × b) / GCD(a, b). For more than two numbers, the GCD and LCM are computed pairwise in sequence (the GCD of the first and second number, then that result with the third number, and so on).

05

Inputs, outputs, and assumptions

You enter two or more positive whole numbers. The tool shows the GCD and LCM of all the numbers entered. Empty rows are ignored until filled in.

06

Limitations and common mistakes

This calculator only accepts positive whole numbers — negative numbers, zero, or decimals are not valid for a GCD/LCM calculation. A common mistake is mixing up GCD and LCM: the GCD is always less than or equal to the smallest number entered, while the LCM is always greater than or equal to the largest number entered.

07

Privacy and local processing

The calculation runs in your browser. The numbers you enter are never uploaded, stored, or shared, and closing the tab clears everything.

08

Frequently asked questions

What are GCD and LCM?

The LCM (Least Common Multiple) is the smallest number that all the entered numbers divide into evenly. The GCD (Greatest Common Divisor, also called GCF) is the largest number that divides evenly into all of them.

What's the difference between GCD and LCM?

The GCD finds the largest shared factor (always less than or equal to the smallest number), while the LCM finds the smallest shared multiple (always greater than or equal to the largest number).

Can it calculate the GCD/LCM for more than two numbers?

Yes. Click "Add number" to add as many rows as you need.

Why are negative numbers or decimals not accepted?

GCD and LCM are defined for positive whole numbers. Negative numbers, zero, or decimals do not have a standard GCD/LCM definition in this context.

Is my data saved?

No. Everything is calculated in your browser; nothing is sent to a server.

Related tools

Related tools

Missing a tool, or found a bug?We build Tooleem around what you need. Tell us what to add or fix.
Tell us