Skip to content
D DocNectar

Free Relatively Prime Calculator

Check whether two numbers are relatively prime (coprime) by computing their GCD via the Euclidean algorithm.

100% Free No Signup Works on all devices

Built and fact-checked by the DocNectar team — see our editorial standards

Thanks for rating!

Key Features

Instant Calculation

Get accurate results in real time with our optimized algorithm.

Mobile Friendly

Fully responsive design. Works on all devices & screen sizes.

Privacy Focused

Your data stays on your device. We don't store any inputs.

100% Free

No hidden costs. This tool is completely free forever.

Two numbers are relatively prime (or coprime) if they share no common factor other than 1 — that is, their greatest common divisor (GCD) is 1. This tool checks this using the Euclidean algorithm and shows every division step.

How it works

The Euclidean algorithm repeatedly replaces the larger of the two numbers with the remainder of dividing it by the smaller, until the remainder reaches 0. The last non-zero remainder is the GCD — if that GCD equals 1, the numbers are relatively prime.

  1. Enter number A.
  2. Enter number B.
  3. Click Calculate to see your results.

Examples

Two coprime numbers

14 and 15 are relatively prime, since gcd(14, 15) = 1, even though neither number is itself prime.

Who should use it

  • Number theory and cryptography coursework requiring coprime checks.
  • Simplifying fractions (a fraction is fully reduced exactly when its numerator and denominator are relatively prime).

Industry applications

  • Cryptography (e.g. RSA key generation requires coprime checks)
  • Mathematics education (number theory)

Advantages

  • Shows the complete Euclidean algorithm working, not just a yes/no answer.
  • Clearly reports the GCD alongside the coprime determination.

Limitations

  • Only checks pairs of numbers — not larger sets for pairwise coprimality all at once (see the Chinese Remainder Theorem Calculator for that context).

Common mistakes to avoid

  • Assuming two numbers must individually be prime numbers to be relatively prime to each other — that's not the requirement.

Best practices

  • To determine if two numbers are coprime, always run the actual Euclidean algorithm (or check the GCD) rather than trying to eyeball shared factors, especially for larger numbers.

Tips

  • A fraction is in lowest terms exactly when its numerator and denominator are relatively prime — this tool doubles as a way to verify that.

Frequently asked questions

No — "relatively prime" only requires that the two numbers share no common factor besides 1; neither number needs to be a prime number itself (14 and 15 are a good example, since neither is prime, but they are coprime).
Yes — since gcd(1, n) is always 1 for any positive integer n, 1 is relatively prime to every other positive integer.

Get new calculators and guides in your inbox

No spam — just new tools like Relatively Prime Calculator and practical guides.

Favorites