Check whether a number is prime, distinguishing a proof from strong evidence and naming a factor when it is composite.
GCD Calculator
Find the greatest common divisor of two or more whole numbers, with Euclid's steps and the Bezout coefficients.
- Free
- No sign-up
- Runs in your browser
Input
Two or more whole numbers, separated by commas or spaces.
Ready
Everything happens on this device. No upload, no account, no network request.
How to use this tool
- 1
Enter two or more whole numbers.
- 2
For two numbers the division steps of Euclid’s algorithm are shown, along with the Bezout coefficients.
Questions about GCD Calculator
What are the Bezout coefficients for?
They are integers x and y with gcd(a, b) = xa + yb, and they are what the GCD is usually wanted for rather than the divisor itself. They solve a linear Diophantine equation, and they give the modular inverse used in RSA key generation and in the Chinese remainder theorem.
What is the GCD of a number and zero?
The number itself, because every integer divides zero. So gcd(5, 0) is 5. The GCD of zero and zero is undefined - every integer divides zero, so there is no greatest one - and the tool refuses that case rather than returning 0.
How does it handle negatives?
By taking absolute values, so the result is positive. Divisibility does not depend on sign: 6 divides both 48 and -48.
Is my data sent anywhere?
No. This runs as JavaScript in your browser tab: there is no network request carrying your numbers, nothing reaches a server log, and it keeps working with your connection off. You can confirm it in the browser’s network panel.
Does the GCD Calculator work offline?
Yes. Once the page has loaded it runs entirely as JavaScript on your own device, so the GCD Calculator keeps working with the network switched off and nothing is ever sent to a server.
Related tools
Other tools you might reach for next.
Find the prime factorisation of a whole number, with the divisor count and sum, using Pollard’s rho for large factors.
Find the least common multiple of two or more whole numbers, exactly.
Evaluate an expression with exact fraction arithmetic, trigonometry, logarithms and factorials, reporting whether the result is exact.
Reduce a fraction to lowest terms, with its mixed number and exact decimal form including any repeating block.
Add two fractions exactly, showing the common denominator step and reducing the result.
Subtract one fraction from another exactly, showing the common denominator step.
Multiply two fractions exactly, multiplying across and reducing the result.