LCM and GCF Calculator
Find the Least Common Multiple (LCM) and Greatest Common Factor (GCF/GCD) of up to 6 numbers with step-by-step working.
🔢 What are LCM and GCF?
The Greatest Common Factor (GCF) — also called the Greatest Common Divisor (GCD) or Highest Common Factor (HCF) — is the largest positive integer that divides all the given numbers without leaving a remainder. For example, the GCF of 12 and 18 is 6, because 6 is the largest number that divides both 12 and 18 exactly. GCF is fundamental to simplifying fractions and solving division problems.
The Least Common Multiple (LCM) is the smallest positive integer that is divisible by all the given numbers. For example, the LCM of 12 and 18 is 36, because 36 is the smallest number that appears in the multiplication tables of both 12 and 18. LCM is essential for adding and subtracting fractions with different denominators (finding the Least Common Denominator) and solving problems involving repeating events.
The two are related by a beautiful formula: for any two positive integers a and b, LCM(a, b) × GCF(a, b) = a × b. This means once you know the GCF, you can find the LCM with simple arithmetic: LCM = (a × b) ÷ GCF. This calculator uses this relationship internally after computing the GCF via the efficient Euclidean algorithm.
Real-world applications: GCF is used when dividing things into equal groups (the greatest number of equal baskets you can fill), simplifying measurements, and reducing fractions. LCM is used in scheduling (when will two events next coincide?), music (finding common time signatures), and computer science (computing with clock cycles and buffer sizes).
For more than two numbers, GCF is computed iteratively: GCF(a, b, c) = GCF(GCF(a, b), c). Similarly, LCM(a, b, c) = LCM(LCM(a, b), c). This calculator handles up to 6 numbers automatically.
📐 LCM and GCF Formulas
📖 How to Use This Calculator
Examples of valid inputs
12, 18 or 12 18 — both formats work.8, 12, 20 or 8 12 204, 6, 8, 10, 12, 15