Maths & numbers

Coprime number check calculator

Check whether the only common positive divisor is 1.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Neither number needs to be prime. For example, 8 and 9 are coprime although both are composite.

THE FORMULATwo numbers are coprime when gcd(a,b) = 1

A worked example

14 and 25 share no prime factors, so they are coprime.

Good to know

Two composite numbers can still be coprime.

Look for shared factors between the two integers

Factor 14 as 2 × 7 and 25 as 5 × 5. No prime factor appears in both factorizations. Their greatest common divisor is therefore 1, and the answer is Yes. The individual numbers are both composite. Coprimality describes their relationship rather than either number’s own primality.

The Euclidean algorithm reaches the same conclusion without requiring a full factorization. Divide 25 by 14 to get remainder 11, then 14 by 11 to get 3, then 11 by 3 to get 2, and 3 by 2 to get 1. The final nonzero remainder is the gcd.

Fourteen has primes two and seven while twenty-five has two copies of five142×7255×5No shared prime → gcd = 1
The two factorizations share no prime. Their greatest common divisor is 1.

Use coprimality when reducing fractions and finding inverses

If numerator and denominator are coprime, their fraction is already reduced. The fraction 14/25 has no integer common factor to cancel. For 14/21 the gcd is 7, so cancellation gives 2/3. Testing whether both numbers are odd would not answer the same question.

The Modular inverse calculator requires coprimality between its integer and modulus. A common factor above one prevents their integer combination from producing 1. Consecutive positive integers are always coprime because a common divisor would have to divide their difference of one. This is one way to construct test pairs, though many nonconsecutive pairs are also coprime.

A few questions, answered

Is one coprime to every positive integer?

Yes. The greatest common divisor of 1 and any positive integer is 1.

Can an integer above one be coprime to itself?

No. Its gcd with itself is that integer, which exceeds 1.

Find your calculator

Start typing to explore the library.