Premium Converters
Loading
Loading
Loading
Find the LCM and GCD (HCF) of two or more integers using the Euclidean algorithm — useful for simplifying fractions, finding common denominators, and scheduling repeating events.
Math
Generated on May 23, 2026
Find the LCM and GCD (HCF) of two or more integers using the Euclidean algorithm — useful for simplifying fractions, finding common denominators, and scheduling repeating events.
This calculator finds both the Greatest Common Divisor (GCD, also called Highest Common Factor or HCF) and the Least Common Multiple (LCM) of any list of positive integers. GCD is the largest integer that divides every value in your list; LCM is the smallest positive integer that every value divides into. These are essential for simplifying fractions (GCD of numerator and denominator), adding or subtracting fractions (LCM of denominators), scheduling repeating events, and many number-theory problems in competitive mathematics and cryptography.
Formula
GCD via the Euclidean algorithm: GCD(a, b) = GCD(b, a mod b), repeated until b = 0. LCM identity: LCM(a, b) = |a × b| ÷ GCD(a, b). For more than two numbers, apply pairwise — the operation is associative.Class IX or X, your math teacher wrote 'find HCF and LCM of 36 and 48' on the board, and you stared at the page wondering how anyone is supposed to find divisors of 48 in their head. Most students learn this with prime factorization (which works but is tedious), never meeting the Euclidean algorithm — which is faster, older than the Quran, and a genuinely beautiful piece of mathematics. Euclid's trick: keep replacing the larger number with the remainder when you divide, and within a handful of steps you've got the GCD. From there, LCM is just a × b divided by GCD. Practical uses go way beyond homework. Synchronizing traffic lights, finding when three repeating events coincide, simplifying fractions for an answer that won't lose marks, and — at the high end — securing every HTTPS connection you've ever made, because RSA encryption leans heavily on GCD properties of large primes. Real-world example: if you have lessons that repeat every 30, 45, and 60 minutes, they all coincide every LCM(30, 45, 60) = 180 minutes, or 3 hours. That's not a homework problem — that's exactly how rotation schedules at hospitals, schools, and factories get built. This calculator handles two or more inputs and shows both GCD (HCF) and LCM together, with the classical product identity (LCM × GCD = a × b) shown for verification.
This calculator finds both the Greatest Common Divisor (GCD, also called Highest Common Factor or HCF) and the Least Common Multiple (LCM) of any list of positive integers. GCD is the largest integer that divides every value in your list; LCM is the smallest positive integer that every value divides into. These are essential for simplifying fractions (GCD of numerator and denominator), adding or subtracting fractions (LCM of denominators), scheduling repeating events, and many number-theory problems in competitive mathematics and cryptography.
Euclid's algorithm (published around 300 BC and still optimal for this problem) repeatedly replaces the pair (a, b) with (b, a mod b), shrinking the numbers rapidly. When b becomes 0, the remaining a is the GCD. The LCM follows from the beautiful identity LCM(a, b) × GCD(a, b) = a × b, which holds for all positive integers. For longer lists, just chain: GCD(a, b, c) = GCD(GCD(a, b), c). The same logic extends to LCM.
Precomputed LCM and GCD for commonly-asked integer pairs. Useful for fraction arithmetic, scheduling, and math homework.
| Numbers | GCD / HCF | LCM | Product check (LCM × GCD) |
|---|---|---|---|
| 4, 6 | 2 | 12 | 24 (= 4 × 6) |
| 8, 12 | 4 | 24 | 96 (= 8 × 12) |
| 12, 18 | 6 | 36 | 216 (= 12 × 18) |
| 15, 25 | 5 | 75 | 375 (= 15 × 25) |
| 18, 24 | 6 | 72 | 432 (= 18 × 24) |
| 20, 30 | 10 | 60 | 600 (= 20 × 30) |
| 24, 36 | 12 | 72 | 864 (= 24 × 36) |
| 25, 40 | 5 | 200 | 1,000 (= 25 × 40) |
| 36, 48 | 12 | 144 | 1,728 (= 36 × 48) |
| 60, 72 | 12 | 360 | 4,320 (= 60 × 72) |
| 100, 150 | 50 | 300 | 15,000 (= 100 × 150) |
GCD simplifies fractions; LCM finds the least common denominator for adding them — the two most useful applications.
Identity: LCM(a,b) × GCD(a,b) = a × b (only works for two numbers).
GCD and HCF are two names for the same concept — US uses GCD, UK/Pakistan uses HCF.
Euclid's algorithm (300 BC) for GCD is still the fastest known method — unchanged for 2,300 years.
12 and 18: GCD = 6, LCM = 36 — classic textbook example that also shows the identity 12 × 18 = 216 = 6 × 36.
8 and 12: GCD = 4, LCM = 24 — useful when simplifying 8/12 or finding a common denominator.
4, 6, and 10: GCD = 2, LCM = 60 — the minimum time at which three repeating events (every 4, 6, and 10 units) coincide.
Adding fractions: to add 1/4 + 1/6 + 1/10, the LCM of denominators (60) becomes the least common denominator.
Gear ratios: a gear with 24 teeth meshing with one of 36 teeth will return to the same relative position after LCM(24, 36) = 72 teeth of rotation.
Traffic lights: if three signals cycle every 30, 45, and 60 seconds, they synchronize every LCM(30, 45, 60) = 180 seconds (3 minutes).
Jump to a ready-made conversion — useful for quick reference and sharing:
GPA Calculator
Calculate your semester or cumulative Grade Point Average on the 4.0 scale, weighted by credit hours, with support for both weighted and unweighted grading systems.
Grade Calculator
Calculate your final grade from weighted categories like tests, homework, and exams.
Student Result Card Calculator
Subject-wise marks, grades, and a printable school result card — ideal for small schools and parents.
Fraction Calculator
Add, subtract, multiply, and divide proper, improper, and mixed fractions with automatic reduction to lowest terms and decimal equivalents for cooking, carpentry, and homework.
Ratio Calculator
Simplify ratios to lowest terms using GCD and solve proportions like a:b = c:x for any missing value — useful for recipes, map scales, aspect ratios, and mixing ingredients.
Average Calculator
Compute the arithmetic mean, median, mode, range, count, sum, minimum, and maximum from any list of numbers — essential for descriptive statistics, surveys, and grading.
Prime Number Checker
Test whether any integer is a prime number using trial division up to its square root, and view the complete unique prime factorization for composite numbers.
Scientific Calculator
Evaluate complex math expressions with trigonometric functions (sin, cos, tan), logarithms, exponents, square roots, parentheses, and constants like pi and e, following PEMDAS order.
Browse all Math calculators & converters
See every tool in this category, plus FAQs and category-specific guides.