Skip to content

GCD and LCM Calculator

Find the greatest common divisor and least common multiple of whole numbers using exact integer arithmetic.

Use the gcd and lcm calculator

Use 1–100 integers of up to 50 digits each. Results use BigInt and remain exact.

Result

Enter values, then select the action button.

How it works

The greatest common divisor divides every input exactly. The least common multiple is the smallest nonnegative common multiple. Euclid’s algorithm finds the GCD; LCM(a,b) = |a × b| / GCD(a,b). Signs are ignored. GCD(0,0) and any LCM containing zero are defined as zero here.

Worked examples

How to use this tool

Enter your values in the labeled fields, choose the units or mode where shown, and select the action button. Review the method and limits above. Reset restores the example inputs.

What happens to my input?

Calculations run locally in your browser. This tool does not upload your entries, fetch external data, or store input in your URL. See our privacy policy for website-wide details.

Found an issue or need another feature? Suggest an improvement.