GCD and LCM calculator
Greatest common divisor and least common multiple of any set of numbers.
How it works
Finds the greatest common divisor and least common multiple of two or more numbers, with the Euclidean algorithm steps shown.
The Euclidean algorithm is about 2,300 years old and still the method used, because nothing faster has been found for the general case. It works by repeatedly replacing the larger number with the remainder of dividing it by the smaller, until the remainder is zero. The last non-zero remainder is the GCD, and it typically finishes in a handful of steps even for large numbers.
The two are linked: for any pair, GCD × LCM equals the product of the numbers. That is the quickest way to get the LCM once you have the GCD, and it avoids factorising anything.
Where these actually get used: reducing fractions to lowest terms is division by the GCD, and finding a common denominator is the LCM.
This tool runs entirely in your browser. Nothing you enter is sent to a server, logged or stored, and the page keeps working with the network disconnected.
Common questions
- What is the relationship between GCD and LCM?
- For two numbers, GCD × LCM = the product of the numbers. So the LCM is the product divided by the GCD.
- What is the Euclidean algorithm?
- Repeatedly replace the larger number with the remainder of dividing it by the smaller. When the remainder hits zero, the previous remainder is the GCD.
Related pages
- Percentage calculator Work out a percentage of a number, what percent one number is of another, and percentage change.
- Loan and EMI calculator Monthly payment, total interest and total repaid for any loan amount, rate and term.
- BMI calculator Body mass index from height and weight, in metric or imperial, with what the number does and does not mean.
- Tip calculator Work out a tip and split the bill, with the per-person figure rounded sensibly.
- Age calculator Exact age in years, months and days from a date of birth, plus total days and the next birthday.
- Paint calculator How much paint a room needs, allowing for doors, windows and the number of coats.
- Compound interest calculator Growth of a lump sum plus regular contributions, with the interest shown separately.
- Calorie and BMR calculator Resting metabolic rate and daily calorie needs by activity level.
- Dog age calculator A dog's age in human years, using the research formula rather than multiplying by seven.
- Discount calculator Find the sale price and how much you save, including stacked discounts and tax.
Sources
- Calculated on this page — At One Place