Coprime Checker Calculator

Two integers are coprime (or relatively prime) when their greatest common divisor is exactly 1. They need not be prime themselves; the key requirement is that they share no common prime factor. For example, 8 and 15 are coprime because 8 = 2^3 and 15 = 3 times 5 have no overlapping prime factors. Coprimality is a central idea in number theory and underpins algorithms in cryptography (RSA), modular arithmetic (Chinese Remainder Theorem), and fraction reduction. Enter two positive integers below to instantly check whether they are coprime and see the GCD that determines the answer.

Enter a positive integer
Enter a positive integer
Yes
1.00

Coprime formula

Coprime if and only if GCD(a, b) = 1

GCD is computed using the Euclidean algorithm: GCD(a, b) = GCD(b, a mod b) until b = 0. If the final non-zero value is 1, the numbers are coprime. Any other result means they share a common factor of that magnitude.

Properties of coprime numbers

  • Numbers do not need to be prime to be coprime: 8 and 9 are coprime even though neither is prime.
  • Any two consecutive integers are always coprime.
  • If a and b are coprime, then a^k and b are also coprime for any positive integer k.
  • Euler's totient function phi(n) counts integers from 1 to n that are coprime to n.
  • The Chinese Remainder Theorem requires the moduli to be pairwise coprime.

Coprime checker: frequently asked questions

What does coprime mean?

Two integers are coprime (also called relatively prime) if their only common divisor is 1, meaning GCD(a, b) = 1. For example, 8 and 15 are coprime because they share no common prime factors.

How do you check if two numbers are coprime?

Compute GCD(a, b) using the Euclidean algorithm. If the result is 1, the numbers are coprime. If the result is greater than 1, they share a common factor and are not coprime.

Are consecutive integers always coprime?

Yes. Any two consecutive integers n and n+1 are always coprime. Their only common divisor must divide their difference, which is 1, so GCD(n, n+1) = 1 for all n.

Why does coprimality matter in cryptography?

RSA encryption requires choosing two large prime numbers and computing a public exponent that is coprime to the totient of their product. Euler's theorem, which underpins RSA, only applies when the base and modulus are coprime.

Can a prime number be coprime to another number?

Any prime p is coprime to every positive integer that is not a multiple of p. So GCD(p, n) = 1 whenever p does not divide n, and GCD(p, n) = p whenever p divides n.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 15 June 2026. See our methodology.