The Relatively Prime Calculator provided by Hesapstan checks positive integers by their greatest common divisor and shows whether they are coprime overall.
Relatively prime numbers have GCD equal to 1
Two or more integers are relatively prime, or coprime, when their greatest common divisor is 1. The numbers themselves do not have to be prime. For example, 8 and 15 are not both prime, but they are coprime because they share no common divisor greater than 1.
This calculator computes the overall GCD of the positive integers you enter. If the GCD is 1, the overall verdict is relatively prime. If the GCD is greater than 1, the numbers are not relatively prime.
The GCD is the test for coprimality
The greatest common divisor is the largest positive integer that divides all selected numbers. In a coprimality check, the key question is whether this value is exactly 1.
For 8 and 15, GCD(8, 15) = 1, so the numbers are coprime. For 12 and 18, GCD(12, 18) = 6, so they are not coprime.
The computation is based on Euclidean GCD logic for integers. This page does not promise prime factorization or individual primality testing.
Overall coprimality and pairwise coprimality are different
When you enter more than two numbers, the overall GCD checks whether all numbers share a common divisor greater than 1. That does not always mean every pair of numbers is coprime.
For 6, 10, and 15, the overall GCD is 1. However, 6 and 10 share 2, and 10 and 15 share 5. The pairwise table is useful because it reveals these pair-level relationships.
If every pair has GCD 1, the numbers are pairwise coprime. Pairwise coprimality is a stronger condition than simply having overall GCD equal to 1.
The calculator accepts positive integers only
Enter at least two positive integers. Decimal values, negative numbers, and a single-number input are outside the scope of this calculator.
- 8; 15 → GCD 1, coprime
- 12; 18 → GCD 6, not coprime
- 7; 11; 13 → coprime overall and pairwise
- 6; 10; 15 → overall GCD 1, but some pairs are not coprime
Use this page for integer number theory checks. It is not a decimal calculator, a negative-number tool, or a prime factorization page.
Coprime does not mean each number is prime
A common mistake is to think that coprime numbers must be prime numbers. They do not. For example, 14 and 25 are coprime because their only common divisor is 1, even though 14 is composite.
Different prime numbers are always coprime with each other, but many composite numbers can also be relatively prime to one another.
Frequently Asked Questions
What does relatively prime mean?
Numbers are relatively prime, or coprime, when their greatest common divisor is 1.
How is GCD related to coprimality?
Coprimality is checked through the GCD. If the GCD is 1, the numbers are coprime. If it is greater than 1, they are not coprime.
Do coprime numbers have to be prime numbers?
No. For example, 8 and 15 are both composite or not both prime, but they are coprime because their GCD is 1.
Is pairwise coprimality the same as overall coprimality?
No. For 6, 10, and 15, the overall GCD is 1, but some pairs share common factors. Pairwise coprimality is the stronger condition.
If numbers are pairwise coprime, are they also coprime overall?
Yes. If every pair has GCD 1, then the whole set also has GCD 1. The reverse is not always true.
Is 1 coprime with every positive integer?
Yes. Since GCD(1, n) = 1 for any positive integer n, 1 is coprime with every positive integer.
Does this calculator do prime factorization?
No. It reports the overall GCD and pairwise GCD analysis. It does not promise prime factorization or primality testing.