GintiCalcEvery calculation

NumberTheory

GCD & LCM Calculator

Enter any list of positive integers — see GCD, LCM, and the prime factorisation of each.

Greatest common divisor and lowest common multiple

GCD is the largest number dividing every input; LCM is the smallest number every input divides into.

NumbersGCDLCM
7, 13191
12, 18636
15, 25575
8, 12, 204120
48, 60, 84121680
100, 75, 5025300

The first row is a coprime pair: 7 and 13 share no factor beyond 1, so their LCM is simply their product. That is the general rule - GCD times LCM equals the product of two numbers, so 12 and 18 give 6 times 36 equals 216, which is 12 times 18. GCD is what reduces a fraction to lowest terms; LCM is what gives you a common denominator when adding them. The Euclidean algorithm computes GCD by repeated remainder and is one of the oldest algorithms still in everyday use.

Use cases

GCD helps simplify fractions and decode ratios. LCM helps find common denominators and synchronise repeating events (e.g., gears, schedules).

The Euclidean algorithm

The fastest way to find GCD: divide the larger number by the smaller, take the remainder, and repeat. GCD(48, 18): 48 ÷ 18 = 2 remainder 12, then 18 ÷ 12 = 1 remainder 6, then 12 ÷ 6 = 2 remainder 0. GCD = 6.

Frequently asked questions

What is GCD and LCM?

GCD (Greatest Common Divisor) is the largest number that divides all given numbers evenly. LCM (Least Common Multiple) is the smallest number that all given numbers divide into evenly. For 12 and 18: GCD = 6 (both divisible by 6), LCM = 36 (smallest number divisible by both 12 and 18).

How do I find GCD using prime factorisation?

Factor each number into primes, then multiply the common prime factors at their lowest powers. 12 = 2² × 3, 18 = 2 × 3². Common factors: 2¹ × 3¹ = 6. For LCM, use the highest powers instead: 2² × 3² = 36.

What is GCD used for?

Simplifying fractions: divide numerator and denominator by their GCD. 18/24: GCD(18,24) = 6, so 18/24 = 3/4. Also used in: finding common denominators, gear ratios, tiling problems (largest square tile for a rectangle), and cryptography (RSA algorithm uses GCD).

Related Math calculators

You might also like

Last updated: September 6, 2026