GCD and LCM Calculator

Live

GCD and LCM Calculator finds the greatest common divisor (GCD, also called HCF) and the least common multiple (LCM) of two or more whole numbers.

Runs in your browser: what you enter is processed on your device and not uploaded to MyToolDock.

GCD by Euclid's algorithm and LCM from LCM(a, b) = a x b / GCD(a, b), applied across the whole list. Uses exact big-number arithmetic, so large inputs do not lose digits. Zero and negative numbers are handled by their absolute value; the LCM with zero is 0.

What is GCD and LCM Calculator?

GCD and LCM Calculator finds the greatest common divisor (GCD, also called HCF) and the least common multiple (LCM) of two or more whole numbers. It uses exact big-number arithmetic, so large inputs keep every digit. Negative numbers use their absolute value.

How It Works

  1. Enter two or more whole numbers separated by commas, spaces or new lines in the input fields on this page.
  2. Press the button to run GCD and LCM Calculator.
  3. Read the GCD, the LCM and, for two numbers, the steps of Euclid's algorithm in the result area, and copy or download it.

Common Uses

Good to Know

The LCM of the denominators is the smallest common denominator when adding fractions.

GCD and LCM in plain terms

The greatest common divisor (GCD, also called the highest common factor) is the largest whole number that divides all your numbers. The least common multiple (LCM) is the smallest positive number that all of them divide into.

They are linked: for two numbers, GCD x LCM = the product of the numbers.

Euclid's algorithm

To find the GCD of two numbers, divide the larger by the smaller and keep the remainder; repeat with the smaller number and the remainder until the remainder is 0. The last non-zero remainder is the GCD. The tool shows these steps for two numbers. For a list it applies the method across all of them.

Worked example

For 12, 18 and 24 the GCD is 6 and the LCM is 72. Dividing the numerator and denominator of 12/18 by their GCD 6 simplifies it to 2/3, and 72 is the smallest number that 12, 18 and 24 all divide into.

Where you use them

Use the GCD to simplify fractions and split things into equal groups. Use the LCM to find a common denominator or to work out when repeating cycles line up, such as two buses that run every 12 and 18 minutes.

Frequently Asked Questions

What does it mean if the GCD is 1?

The numbers are coprime: they share no factor other than 1.

Can I enter more than two numbers?

Yes. Separate them with commas, spaces or new lines.

What about zero or negative numbers?

Negative numbers use their absolute value. The GCD with zero is the other number, and the LCM with zero is 0.

What does GCD and LCM Calculator do?

GCD and LCM Calculator finds the greatest common divisor (GCD, also called HCF) and the least common multiple (LCM) of two or more whole numbers. It uses exact big-number arithmetic, so large inputs keep every digit. Negative numbers use their absolute value.

What do I need to enter in GCD and LCM Calculator?

Two or more whole numbers separated by commas, spaces or new lines.

Is my data private in GCD and LCM Calculator?

Everything is calculated in your browser.

Is MyToolDock GCD and LCM Calculator free to use?

Yes, MyToolDock GCD and LCM Calculator is 100% free with no registration, subscriptions, or limits. All features are fully unlocked.

Related Tools

Add Business Days Calculator Age Calculator Amortization Schedule Calculator Area Converter Fuel Cost Calculator GPA Calculator

More Calculator Tools guides

More in Calculator Tools · Browse all tools

Developer Scratchpad

Copied to clipboard!