Skip to content
Home → All Tools → Math Tools → GCD & LCM Calculator
MATH TOOLS

GCD & LCM Calculator

Find the greatest common divisor (GCD) and least common multiple (LCM) of two positive whole numbers.

Use the tool

Enter your values below. Results are calculated in your browser.

About this GCD & LCM Calculator

GCD & LCM Calculator finds two common number relationships at once. The greatest common divisor is the largest whole number that divides both inputs exactly, while the least common multiple is the smallest positive whole number that both inputs divide into exactly.

Formula or method

GCD is found with the Euclidean algorithm. For positive integers, LCM(a,b) = |a × b| ÷ GCD(a,b).

Example

For 18 and 24, the GCD is 6 and the LCM is 72.

Common uses

  • Simplify fraction and ratio work by finding a common divisor.
  • Find a common cycle or interval with the least common multiple.
  • Check arithmetic homework or number-theory calculations.

How to use this tool

  1. Enter the values or text requested by the calculator.
  2. Choose units or options when the tool provides them.
  3. Select the calculation button and review the result.
  4. Use the formula, example and notes on this page to check whether the result fits your situation.

Important note

Use positive whole numbers. Very large values can exceed the exact integer range of a web browser number.

Frequently asked questions

What is the difference between GCD and LCM?

GCD is the largest factor shared by both numbers, while LCM is the smallest positive multiple shared by both numbers.

Can I enter decimals or negative numbers?

This version is designed for positive whole numbers only.