Everyday Math Essentials
Cover quick calculations for percentages, fractions, averages, and ratios used in school, shopping, and spreadsheets.
Calculate Greatest Common Divisor and Least Common Multiple
The Greatest Common Divisor (GCD), also known as the Greatest Common Factor (GCF) or Highest Common Factor (HCF), is the largest positive integer that divides both numbers without leaving a remainder. For example, the GCD of 12 and 18 is 6, because 6 is the largest number that divides both 12 and 18 evenly.
The Least Common Multiple (LCM) is the smallest positive integer that is divisible by both numbers. For example, the LCM of 12 and 18 is 36, because 36 is the smallest number that both 12 and 18 divide into evenly.
The most efficient method to calculate GCD is the Euclidean Algorithm:
The LCM can be calculated using the relationship with GCD:
LCM(a, b) = (a × b) / GCD(a, b)
This formula works because the product of two numbers equals the product of their GCD and LCM.
GCD is the largest number that divides both numbers evenly, while LCM is the smallest number that both numbers divide into evenly. GCD is always less than or equal to the smaller number, while LCM is always greater than or equal to the larger number.
Yes! For multiple numbers, calculate GCD or LCM pairwise. For example, GCD(a, b, c) = GCD(GCD(a, b), c). The same applies to LCM. This calculator focuses on two numbers for simplicity.
Two numbers are coprime (or relatively prime) if their GCD is 1. For example, 8 and 15 are coprime because GCD(8, 15) = 1. Coprime numbers have no common factors other than 1.
The Euclidean Algorithm is very efficient because it reduces the problem size rapidly with each step. It has a time complexity of O(log min(a, b)), making it much faster than checking all possible divisors, especially for large numbers.
This formula works because the product of two numbers contains all their prime factors. The GCD contains the common factors, so dividing by GCD removes the duplicate factors, leaving only the factors needed for the LCM.
If one number is a multiple of the other (e.g., 6 and 18), then the GCD is the smaller number (6) and the LCM is the larger number (18). This is because the smaller number divides the larger one perfectly.
These grouped paths are designed to help you continue with the most common follow-up calculations in this category.
Cover quick calculations for percentages, fractions, averages, and ratios used in school, shopping, and spreadsheets.
Move from powers and logarithms into more advanced solving tools when the problem gets more complex.
Calculate dimensions, area, and triangle relationships using a connected geometry workflow.