About GCD Calculator
GCD Calculator returns the greatest common divisor of two numbers — the largest whole number that divides both without leaving a remainder. It does this with the Euclidean algorithm, repeatedly replacing the larger number with the remainder of dividing it by the smaller until the remainder reaches zero, which is both fast and exact for integers.
Both inputs are floored and taken as absolute values before the calculation, so a negative entry or a decimal behaves predictably rather than producing a fractional answer. The greatest common divisor is defined for integers, and this normalisation is what keeps the result in that domain.
The common divisor of zero and zero is zero — every number divides zero, so there is no greatest one, and the algorithm terminates immediately on that convention. More usefully, the result is the figure you need before reducing a fraction, which is exactly what the Fraction Simplifier does with this same routine.
How to use GCD Calculator
- 1 Enter the first number.
- 2 Enter the second number.
- 3 Read the greatest common divisor of the two.
Frequently asked questions
What is the GCD of zero and another number?
The other number itself. Since every integer divides zero, the largest one that also divides the other value is that value. Zero and zero returns zero, since no greatest divisor exists in that case.
Does it work for more than two numbers?
Not in a single pass. The GCD is associative though, so you can fold: take the result for the first two, then use it with the third. The same routine applied repeatedly gives the correct answer for any length of list.
Why did my decimal input get rounded down?
Because divisibility is a property of whole numbers, and the tool floors both inputs to keep the calculation in that domain. If you need to simplify a ratio of decimals, scale both by a power of ten first so they become integers.
How does it decide which of the two numbers the answer should be?
It does not — the greatest common divisor is symmetric, so the order of the inputs never changes the result. The algorithm simply swaps internally as it works.
Free, online, and private
Free to use
GCD Calculator is completely free. There is no account to create, no login, and no hidden charge or usage limit.
Runs online in your browser
It is a free online tool that runs entirely in your browser. Nothing to download or install — open the page and start using it right away.
Your data stays private
All processing happens locally on your device. Your input is never uploaded, stored, or tracked, so it never leaves your browser.
How GCD Calculator behaves in detail
These are the specifics of this implementation — the exact ranges, defaults and fixed settings you are working with.
| Parameter | Value |
|---|---|
| Algorithm | Euclid's algorithm, recursive — gcd(b, a mod b) repeated until the remainder is 0 |
| Inputs | exactly two number fields, a and b — there is no box that takes a longer list |
| Negative values | sign is discarded with Math.abs before the algorithm runs |
| Decimals | floored first, so 7.9 and 7.1 both enter the calculation as 7 |
| Zero case | if one input is 0 the other is returned unchanged; gcd(0, 0) evaluates to 0 |
| Output | a single line, "GCD: n" |
Compiled from the implementation of this tool and checked against it by itoolnet.
What GCD Calculator does not do
Knowing the edges of a tool saves more time than another list of its features. These are the cases where it will not do what you might expect.
- It handles a pair and nothing more. The divisor of three or more numbers has to be found by folding — run the first two, then feed the answer in beside the third — and because no factorisation is shown there is nothing on the page to help you check that fold.
- Fractional inputs are truncated rather than rounded, so the decimal part disappears without notice. Both 7.9 and 7.1 become 7, which can silently turn a question about two decimal fractions into a question about two different integers.
- Only the final divisor is reported. The intermediate remainders that make Euclid's method useful for teaching or for checking by hand are never displayed, and the least common multiple of the same pair is not offered alongside it.
Tested and documented by itoolnet, the team that builds and maintains this site.