Mathematics

GCD and LCM Calculator

Find the greatest common divisor and least common multiple of a list of signed integers.

01Input and settings

The calculation runs in your browser. You can use the tool without installing software.

02Result

Waiting for input
Waiting for input

Enter your values or load the example to see the result here.

About this tool: GCD and LCM Calculator

Find the greatest common divisor and least common multiple of a list of signed integers.

Enter signed integers separated by spaces, line breaks or semicolons. Signs are ignored for GCD and LCM; any zero makes the LCM zero, and an all-zero list has GCD zero. The Euclidean algorithm and integer arithmetic avoid rounding large values.

How the calculation works

gcd(a,b) = gcd(b,a mod b); lcm(a,b) = |ab| / gcd(a,b)

Worked example

Input
12 18 24
GCD = 6
LCM = 72

Questions and answers

What does this tool do?

Find the greatest common divisor and least common multiple of a list of signed integers. Enter signed integers separated by spaces, line breaks or semicolons. Signs are ignored for GCD and LCM; any zero makes the LCM zero, and an all-zero list has GCD zero. The Euclidean algorithm and integer arithmetic avoid rounding large values.

What affects precision and input format?

These operations preserve integer or decimal precision with string and integer arithmetic. Input size is limited to keep the page responsive.

Where are the calculations performed?

The calculation runs in your browser. You can use the tool without installing software.

Comments (0)

Share your thoughts — please be polite and stay on topic.

No comments yet. Leave a comment — share your opinion!

To leave a comment, please log in.

Log in to comment