Maths & numbers

GCD and LCM calculator

Calculate the greatest common divisor and least common multiple of two or more numbers. Shows step-by-step Euclidean algorithm.

  • Free, no sign-up
  • No data stored
  • Reviewed 2026-01-15

Your details

Results

About the GCD & LCM Calculator

Enter two or more integers to find their GCD (greatest common divisor, also called HCF) and LCM (least common multiple). The calculator shows the Euclidean algorithm steps for the GCD computation.

How to use the GCD & LCM Calculator

  1. Enter two or more numbers separated by commas.
  2. View GCD, LCM and algorithm steps.

Frequently asked questions

What is the Euclidean algorithm?

A method to find GCD by repeatedly dividing: GCD(a,b) = GCD(b, a mod b) until the remainder is 0. The last non-zero remainder is the GCD.

How is LCM related to GCD?

LCM(a,b) = |a × b| / GCD(a,b). Once you know the GCD, the LCM follows immediately.

Can I enter more than two numbers?

Yes. The calculator finds GCD and LCM iteratively: GCD(a,b,c) = GCD(GCD(a,b), c).