Coprime Checker
Enter two whole numbers to see their GCD and whether they are coprime.
Result
How it is calculated
The tool finds the greatest common divisor with the Euclidean algorithm: set x = a, y = b, then repeat (x, y) → (y, x mod y) until y = 0; the last x is gcd(a, b). The two numbers are coprime exactly when that gcd is 1, and the tool reports the gcd together with a Yes/No answer (Yes = coprime). Both inputs must be whole numbers of at least 1; decimals such as 12.5, zero and negatives return no result. Digit strings are read exactly, so integers up to 9,223,372,036,854,775,807 (the 64-bit limit) give an exact gcd; anything larger gives no result. Remember that coprime does not mean prime: 8 and 15 are coprime although neither is prime, while 7 and 14 are not coprime although 7 is prime.
Worked example
Check 84 and 36. Step 1: 84 mod 36 = 12, so the pair becomes (36, 12). Step 2: 36 mod 12 = 0, so the algorithm stops and the last non-zero value is 12. The gcd is 12, which is not 1, so the answer is No: 84 and 36 are not coprime. They share the factors 2, 3, 4, 6 and 12.
Common mistakes
- Assuming coprime means both numbers are prime. Only the gcd matters: 9 and 16 are coprime, 3 and 9 are not.
- Thinking that consecutive numbers might share a factor. Any two consecutive whole numbers are always coprime, so a gcd of 1 is the expected result.
- Reading the Yes/No answer as the gcd. The answer shows only Yes or No; the gcd is the separate first output.
- Entering 0, a negative number or a decimal. Only positive whole numbers are accepted, so turn a fraction's numerator and denominator into integers first.
- Pasting a number with more than 19 digits, such as a long key or factorial. Above the 64-bit limit the tool shows no result instead of an approximate gcd.
About this calculator
Two whole numbers are coprime, or relatively prime, if the only positive integer that divides both of them evenly is 1 — their greatest common divisor (GCD) equals 1, even though neither number individually needs to be prime. This calculator finds that GCD using the Euclidean algorithm, one of the oldest algorithms in mathematics, which repeatedly replaces the larger number with the remainder of dividing it by the smaller until the remainder reaches zero.
Coprimality is a load-bearing concept well beyond number theory homework: RSA public-key cryptography requires choosing an encryption exponent that is coprime with a totient value to guarantee the encryption is mathematically invertible, gear designers deliberately choose coprime tooth counts for meshing gears to spread wear evenly across all tooth combinations rather than repeating the same pairs, and coprime denominators are what let fractions be added by finding a true least common denominator.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments