The GCD & LCM Calculator finds the Greatest Common Divisor and Least Common Multiple of two or more numbers. It uses the Euclidean algorithm and prime factorisation to compute results efficiently.
Enter your numbers and the calculator will show the GCD, LCM, prime factorisations, and step-by-step working. Useful for simplifying fractions, finding common denominators, and solving number theory problems.
Your calculations will appear here
The greatest common divisor (GCD) of two or more integers is the largest positive integer that divides each of them without leaving a remainder. It is also called the highest common factor (HCF). The Euclidean algorithm computes the GCD efficiently: GCD(a, b) = GCD(b, a mod b), repeated until the remainder is zero. The last non-zero remainder is the GCD.
The least common multiple (LCM) of two or more integers is the smallest positive integer that is divisible by each of them. The relationship between GCD and LCM is given by the formula: LCM(a, b) = |a * b| / GCD(a, b). This means you only need to compute the GCD to derive the LCM.
Prime factorisation provides an alternative method. The GCD takes the lowest power of each common prime factor, while the LCM takes the highest power of every prime factor present in any of the numbers. For example, 12 = 2^2 * 3 and 18 = 2 * 3^2, so GCD = 2 * 3 = 6 and LCM = 2^2 * 3^2 = 36.
Problem: Find the GCD of 48 and 18.
Solution: GCD(48, 18): 48 = 2 * 18 + 12. GCD(18, 12): 18 = 1 * 12 + 6. GCD(12, 6): 12 = 2 * 6 + 0. The last non-zero remainder is 6.
Answer: GCD(48, 18) = 6
Problem: Find the LCM of 12 and 8.
Solution: First find GCD(12, 8) = 4. Then LCM = (12 * 8) / 4 = 96 / 4 = 24.
Answer: LCM(12, 8) = 24
Problem: Find the GCD of 24, 36, and 60.
Solution: GCD(24, 36) = 12. Then GCD(12, 60) = 12.
Answer: GCD(24, 36, 60) = 12
Problem: A recipe calls for 150g flour and 225g sugar. Simplify the ratio.
Solution: Find GCD(150, 225). 225 = 1 * 150 + 75. 150 = 2 * 75 + 0. GCD = 75. Divide both: 150/75 = 2, 225/75 = 3.
Answer: The ratio simplifies to 2:3
Calculate percentages instantly. Find what percent of a number, percentage change, and percentage difference. Free, fast, no signup.
Add, subtract, multiply, and divide fractions. Simplify fractions and convert to mixed numbers. Free online fraction calculator.
Simplify ratios and find missing values in proportions. Free online ratio calculator with step-by-step results.
Calculate powers and exponents instantly. Compute base raised to any power including negative and fractional exponents. Free online tool.
Calculate logarithms with any base. Find natural log (ln), log base 10, and custom base logarithms. Free online log calculator.
Find all factors, prime factorisation, factor pairs, GCD, and LCM. Free online factor calculator with instant results.