Greatest Common Divisor (GCD) Calculator
Find the greatest common divisor (GCD/HCF) of two or more integers of any size, with Euclidean algorithm steps.
Your inputs
Results
GCD
12
- Coprime (GCD = 1)?
- No
✓Exact calculation — rounded only for display
Show calculation steps
- Euclidean algorithm for the first two numbers:
- 48 = 0 × 180 + 48
- 180 = 3 × 48 + 36
- 48 = 1 × 36 + 12
- 36 = 3 × 12 + 0
What this calculator does
The GCD is the largest number that divides all the given numbers exactly. It is used to simplify fractions and ratios.
Formula and method
Euclid: gcd(a, b) = gcd(b, a mod b), until the remainder is 0.
Worked example
Calculated by this tool with its default inputs:
Inputs
- Whole numbers: 48, 180, 300
Results
- GCD: 12
- Coprime (GCD = 1)?: No
How to read the results
Numbers with GCD 1 are coprime.
Assumptions and limitations
- Uses arbitrary-precision integers, so very large numbers are exact.
Questions
GCD or HCF?
They are the same: greatest common divisor and highest common factor.
Methodology and verification
- Result type
- Exact mathematical calculation (rounded only for display)
- Formula version
- 1.0
- Automated verification
- 5 reference and validation test cases, checked against independently computed values. The site cannot be built if any of them fail.
- Editorial review
- Awaiting human editorial review. The explanation was drafted with AI assistance; the formula and examples are verified by the automated tests above.
Privacy
Everything you enter is calculated in this browser and is not sent to Numerith or anyone else. Inputs are added to a share link only if you choose to include them. Privacy policy