Relatively Prime (Coprime) Calculator

Are the two numbers coprime?

How to use

  1. Enter your values in the fields above.
  2. Press Calculate to see your result instantly.
  3. Use the Share button to copy a link to your result.

About this calculator

Two integers are relatively prime (or coprime) when their greatest common divisor is 1 — meaning they share no common factor larger than 1, even if neither number is itself prime. The standard way to check is the Euclidean algorithm, which repeatedly replaces the larger number with the remainder of dividing it by the smaller until the remainder hits zero; if the last nonzero remainder is 1, the pair is coprime.

Coprimality is a working requirement in several practical fields, not just a textbook curiosity. In RSA cryptography, the public exponent must be chosen to be coprime with the totient of the modulus for the key pair to work correctly. Mechanical engineers deliberately choose gear tooth counts that are coprime so that the same two teeth do not repeatedly mesh together, which spreads out wear evenly and reduces resonant noise. It also governs whether a fraction is already in lowest terms — a fraction a/b is fully simplified exactly when a and b are relatively prime.

Enter your two integers and this calculator runs the Euclidean algorithm to tell you whether they are coprime, along with their greatest common divisor.

Was this helpful?

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators