FinCalc India Logo
FinCalcIndia
Math & ArithmeticVerified: 2026-10-05

LCM and GCD Calculator

Calculate the Least Common Multiple (LCM) and Greatest Common Divisor (GCD / HCF) for two or more integers with prime factorization trees and division steps.

Direct Answer:The Greatest Common Divisor (GCD / HCF) of 24 and 36 is 12 (the largest number dividing both). The Least Common Multiple (LCM) is 72 (the smallest number that is a multiple of both). For two numbers, LCM(a, b) = (a × b) ÷ GCD(a, b).
Advertisement Placeholder
Ad Slot #header-bottom

Adjust Parameters

Separate whole numbers with commas, spaces, or semicolons (e.g. 24, 36).

Quick Number Sets:
Prime Factorizations:
24 = 2^3 × 3
36 = 2^2 × 3^2
GCD (HCF) = 12 | LCM = 72
GCD: 12 | LCM: 72

Numbers: {24, 36} | Divisors: 1, 2, 3, 4, 6, 12

The Greatest Common Divisor is 12 and the Least Common Multiple is 72.
Greatest Common Divisor (HCF)
12
Least Common Multiple (LCM)
72
All Common Divisors
1, 2, 3, 4, 6, 12
First 5 Common Multiples
72, 144, 216, 288, 360

Step-by-Step Solution Breakdown

  • Input numbers: 24, 36
  • 1. Prime Factorization:
  • 24 = 2^3 × 3
  • 36 = 2^2 × 3^2
  • 2. Greatest Common Divisor (GCD / HCF):
  • Taking lowest powers of all common prime factors: GCD = 12
  • Common factors of {24, 36} are: 1, 2, 3, 4, 6, 12
  • 3. Least Common Multiple (LCM):
  • Taking highest powers of all prime factors: LCM = 72
  • First 5 common multiples: 72, 144, 216, 288, 360
Advertisement Placeholder
Ad Slot #mid-content

How LCM and GCD Calculator is Calculated

Transparent mathematical formulas and assumptions used across our financial engines.

Mathematical Formula
\gcd(a, b) = \text{largest integer dividing both} \quad | \quad \text{lcm}(a, b) = \frac{|a \times b|}{\gcd(a, b)}

Variables & Legend

GCD
Greatest Common Divisor (HCF)
LCM
Least Common Multiple
a, b
Input Integers

Step-by-Step Calculation

  1. Prime Factorize: n = p_1^{a_1} \times p_2^{a_2} \dots

    Express each number as a product of prime powers.

  2. Find GCD: \gcd = \prod p_i^{\min(a_i, b_i)}

    Multiply lowest powers of common prime factors.

  3. Find LCM: \text{lcm} = \prod p_i^{\max(a_i, b_i)}

    Multiply highest powers of all prime factors.

Conventions & Assumptions

  • For any two positive integers a and b, the fundamental identity holds: GCD(a, b) × LCM(a, b) = a × b.
  • If GCD(a, b) = 1, the numbers are said to be relatively prime or coprime.

Frequently Asked Questions

GCD (Greatest Common Divisor, or HCF - Highest Common Factor) is the largest number that divides all numbers evenly. LCM (Least Common Multiple) is the smallest number that all numbers can divide into evenly.

Related Calculators & Scenarios

Explore Alternatives