๐Ÿ”ข

LCM & GCD Calculator

Find the least common multiple (LCM) and greatest common divisor (GCD/HCF) of two or more numbers.

Built and maintained by Abdur Rehman ยท Free, no sign-up

Loading LCM & GCD Calculatorโ€ฆ
๐Ÿ”’PrivateRuns in your browser โ€” nothing is uploaded.
โšกFastInstant results, no waiting in queues.
๐Ÿ’ธFreeNo sign-up, no watermark, no limits.
๐Ÿ“ฑAnywhereWorks on phone, tablet and desktop.
</> Embed this calculator on your website โ€” free

Paste this code into any web page or blog post (WordPress: use a โ€œCustom HTMLโ€ block). It's free for personal, school and business sites โ€” just keep the credit link.

How to use the LCM & GCD Calculator

  1. Enter two or more numbers
  2. Separate them with commas
  3. See the LCM, GCD and prime factors

LCM and GCD of any set of numbers

Enter two or more numbers, separated by commas or spaces, to get the LCM (least common multiple) and the GCD โ€” also called the HCF or GCF (greatest common factor). Each number's prime factorisation is listed alongside, so you can check your working.

Worked examples

  • 24 = 2ยณ ร— 3 and 36 = 2ยฒ ร— 3ยฒ. The LCM takes the highest powers: 2ยณ ร— 3ยฒ = 72. The GCD takes the lowest: 2ยฒ ร— 3 = 12.
  • The LCM of 8, 24 and 36 is also 2ยณ ร— 3ยฒ = 72.
  • Shortcut for two numbers: LCM = a ร— b รท GCD โ†’ 24 ร— 36 รท 12 = 72.

Methods taught in school

  • Prime factorisation โ€” break each number into primes, as above.
  • Division (Euclid's algorithm) โ€” divide, keep the remainder, repeat: 36 รท 24 = 1 r 12; 24 รท 12 = 2 r 0 โ†’ GCD 12.
  • Ladder method โ€” divide all the numbers by common primes in a ladder, then multiply the numbers down the side and along the bottom for the LCM.

In Python, math.gcd() and math.lcm() do the same job.

Frequently asked questions

How accurate is the LCM & GCD Calculator?

LCM & GCD Calculator uses standard, widely accepted formulas and calculates instantly as you type. Results are for general information โ€” for important academic decisions, please confirm with a qualified professional or your institution.

๐Ÿงฎ Keep exploring Math & Converters

See all Math & Converters