What does this calculator do?
The greatest common divisor (GCD) is the largest positive integer that divides both input integers exactly.
Formula
The Euclidean algorithm repeatedly replaces the larger value with the remainder:
GCD(a, b) = GCD(b, a mod b), until b = 0
How to use it
Enter two positive whole numbers. The calculator applies the Euclidean algorithm and returns their GCD.
Worked example
For 24 and 36: 36 mod 24 = 12 and 24 mod 12 = 0, so GCD(24, 36) = 12.
Formula version1.0.0
FormulaGCD(a, b) = GCD(b, a mod b), until b = 0
Precision0 decimals
Frequently asked questions
What is the difference between GCD and LCM?
GCD is the largest shared factor; LCM is the smallest positive number divisible by both inputs.
Can the GCD be 1?
Yes. Numbers whose only common positive factor is 1 are called coprime.
Why must the inputs be integers?
Divisibility and the standard Euclidean algorithm are defined here for whole numbers.
Sources
- Standard arithmetic definitions (mean, half-up rounding). The exact formulas used are shown on this page; no external data is involved.
- Khan Academy — Arithmetic (review of the underlying math)
- Reviewed: 2026-08-05
Related calculators
LCM Calculator
Find the smallest positive integer divisible by both input numbers.
Prime Factorization Calculator
Write a whole number as a product of prime powers.
Average Calculator
The average (mean) of any list of numbers, with sum and count shown.
Rounding Calculator
Round any number to the decimal places you choose.
Percentage Calculator
Find what percent one number is of another, with every step shown.
Quadratic Equation Calculator
Solve ax² + bx + c = 0 and inspect its discriminant.
Percentage of a Number
Work out what X% of any number is — for example, 15% of 240.
Scientific Notation Calculator
Express a number as a coefficient multiplied by a power of ten.
Last updated: 2026-08-05 · v1.0.0 · Report an error