GCD (Greatest Common Divisor) Calculator
Euclidean algorithm: gcd(a,b) = gcd(b, a mod b). Supports 2-6 integers.
Result
GCD
12
Of 48, 36.
- Numbers48, 36
- GCD12
- Reduced48/12 = 4, 36/12 = 3
Step-by-step
- Apply Euclidean algorithm pairwise.
- gcd(48, 36) = 12.
How to use this calculator
- Enter 2-4 positive integers.
- Leave optional fields at 0 to ignore.
About this calculator
The GCD (greatest common divisor) of two integers is the largest number that divides both without remainder. The Euclidean algorithm runs gcd(a,b) = gcd(b, a mod b) until b=0, completing in O(log min(a,b)) steps. For 3+ numbers, GCD is associative: gcd(a,b,c) = gcd(gcd(a,b),c). Common use: simplifying fractions (48/36 → divide by gcd 12 → 4/3), and finding shared periods in problems involving multiple cycles.
Frequently asked
GCD = greatest common factor (divides both). LCM = smallest common multiple (both divide it). Linked by gcd(a,b) × lcm(a,b) = a×b.
Related calculators
LCM (Least Common Multiple) Calculator
lcm(a,b) = |a × b| / gcd(a,b). Smallest number that both a and b divide evenly.
Prime Number Checker
Is n prime? Trial division up to √n; identifies smallest divisor and nearest primes if composite.
Prime Factorization Calculator
n = p₁^a₁ × p₂^a₂ × … Trial division to find all prime factors with multiplicity.
Factorial Calculator (n!)
n! = 1 × 2 × … × n. Computes exactly up to 21! (number limit); approximate via Stirling for larger.
Scientific Notation Converter
Convert decimal ↔ scientific notation. Standard form a × 10^b with 1 ≤ |a| < 10.
Square Root Calculator (√n)
√n with integer-perfect-square check, simplified surd form, and decimal expansion.