Whether numbers share a factor — as a set, and pair by pair.
Do they share a factor?
As a set, and pair by pair.
6, 10, 15
coprime, but not pairwise
Taken together the numbers share no common factor, so gcd is 1. But they are NOT pairwise coprime — 6 and 10 share 2. The distinction matters: the Chinese Remainder Theorem needs the pairwise condition, not this one.
gcd
1
nothing shared by all of them
Pairwise coprime?
no
some pair shares a factor
Shared primes
none
which is what coprime means
lcm
30
below the product, by the shared part
The pairs that are not coprime
Each pair of entered values that shares a common factor, with that factor
Pair
gcd
Meaning
6 and 10
2
both are multiples of 2
6 and 15
3
both are multiples of 3
10 and 15
5
both are multiples of 5
A set can be coprime while its pairs are not. If you are using these as moduli in a system of congruences, the Chinese Remainder Theorem asks for the pairwise condition — the set gcd is not enough.
Of the 6 whole numbers from 1 upwards, 2 are coprime to 6. That count is Euler’s totient, and it is exactly how many of them have a modular inverse.
Every pair is checked, not just the set — the two conditions are different and the stronger one is the one that usually matters.
What this tool shows
6, 10 and 15 are coprime: no number above 1 divides all three. But no two of them are coprime — 6 and 10 share 2, 6 and 15 share 3, 10 and 15 share 5. Those are different conditions, and the one you usually need is the second.
Whether two or more numbers are coprime
Their greatest common divisor
The primes they share, if any
Whether every pair is coprime, not just the set
Which pairs are not, when the set is
How many numbers below the first are coprime to it
Set and pairwise The shared primes named Euler’s totient too Any count of numbers
Updated 7 September 2026 · Works in any browser, no installation
They are coprime when their greatest common divisor is 1 — when no whole number above 1 divides all of them. Neither has to be prime: 8 and 15 are coprime because 8 is only 2s and 15 is 3 and 5. Watch the pairwise case though, because a set can be coprime while every pair inside it is not.
At a glance
Formula shown
Two numbers are coprime when gcd(a, b) = 1 \u2014 they share no prime factor. A set is coprime when its overall gcd is 1, and pairwise coprime when every pair has gcd 1. Pairwise coprime implies coprime; the converse is false.
Scenario support
Choosing a valid multiplier for an affine cipher; checking whether a fraction is already in lowest terms; confirming a set of moduli meets the Chinese Remainder Theorem\u2019s condition.
Educational estimate
Planning support from the values you enter — not professional advice.
What coprime means
Two numbers are coprime — also called relatively prime, or mutually prime — when the only positive integer dividing both is 1.
Neither number needs to be prime. 8 and 15 are coprime: 8 factors as 2³ and 15 as 3 × 5, and those lists have nothing in common. That is the real test — compare the prime factorisations and look for an overlap.
1 is coprime to everything, including itself, since nothing above 1 divides it. And any two distinct primes are automatically coprime, which is why prime moduli are so convenient.
Set versus pairwise
This is the distinction the page exists for, and it catches people who have used the idea for years.
Take 6, 10 and 15. No number above 1 divides all three, so gcd(6, 10, 15) = 1 and the set is coprime. But 6 and 10 share 2, 6 and 15 share 3, and 10 and 15 share 5 — not one pair is coprime.
Pairwise coprime is the stronger condition: every pair has gcd 1. It implies the set condition. The converse does not hold, as those three numbers show.
It matters because the Chinese Remainder Theorem asks for the pairwise version. Feed it 6, 10 and 15 on the strength of the set gcd and the classical statement does not apply — the system may still solve, but not for the reason you thought.
Why it decides so much
Fractions in lowest terms. A fraction is fully reduced exactly when its numerator and denominator are coprime. That is the definition of lowest terms, not a test for it.
Modular inverses. a has an inverse modulo n exactly when a and n are coprime. This is the condition behind every valid cipher key and every RSA exponent.
lcm equals the product. For coprime numbers, lcm(a, b) = ab. When they share a factor the lcm is smaller, by exactly the gcd — which is why 4 and 6 have lcm 12 rather than 24.
Gear teeth and cycles. Two gears with coprime tooth counts take the longest possible time to repeat a pairing, which spreads wear evenly. Engineers choose coprime counts deliberately.
Counting the coprimes
Euler’s totient function φ(n) counts the numbers from 1 to n that are coprime to n. The page reports it for your first value.
φ(9) = 6, because 1, 2, 4, 5, 7 and 8 are coprime to 9 while 3 and 6 are not. For a prime p every smaller number qualifies, so φ(p) = p − 1.
The count is exactly the number of residues with a modular inverse, which is why it governs how many valid keys a modulus admits. φ(26) = 12, and there are twelve usable affine cipher multipliers.
It is also multiplicative on coprime factors: φ(mn) = φ(m)φ(n) when m and n are coprime. That identity is what makes RSA key generation tractable.
The edge cases
1 with anything. Coprime, always. gcd(1, n) = 1 for every n, including 1 itself.
0 with anything. gcd(0, n) = n, so 0 is coprime only to 1 and to −1. Every number divides 0, which is the opposite of sharing nothing.
0 with 0. Undefined. Every integer divides zero, so there is no greatest common divisor to name. The page refuses rather than returning 0.
Negatives. Coprimality ignores sign, since divisibility does. −8 and 15 are coprime exactly as 8 and 15 are.
How likely is it
Pick two whole numbers at random. The probability that they are coprime is 6/π², or about 60.79%.
The reasoning is short. Both are even with probability 1/4, both divisible by 3 with probability 1/9, and so on. Multiplying (1 − 1/p²) over every prime gives 1/ζ(2), and ζ(2) = π²/6.
It is a satisfying result: π appears in a question about divisibility that never mentions a circle. It also means coprimality is common rather than special — roughly three pairs in five share nothing at all.
Sources and methodology
Coprimality is a definition, but its consequences are standardised — these are the references.
Method. The set gcd is folded across the values, and every pair is then tested separately rather than inferred from it, because the two conditions are genuinely different. When the gcd exceeds 1 it is factorised so the shared primes can be named. Euler’s totient of the first value is computed from its factorisation, which is the count of numbers below it that have a modular inverse. The suite asserts that pairwise coprimality always implies set coprimality, and separately that the converse fails on real generated triples — so the distinction the page is built on is demonstrated rather than claimed. That engine is verified on every change against 69 hand-written assertions, including that pairwise coprimality always implies set coprimality across four thousand generated triples, and that the converse genuinely fails among them. The count and the per-case breakdown are published on the formula verification page.
Related calculators
Where this goes next:
GCFThe greatest common factor of two to six numbers with all three routes shown — the shared primes to their lower powers, Euclid line by line, and the full factor lists when they are short enough to be honest.
LCMThe least common multiple of two to six numbers, with the prime table that produces it, the multiples themselves, and how far counting would have had to go.
Prime FactorizationBreak any number into primes with the division ladder shown, the number of trial divisions reported, and the argument for why the search can stop at the square root.
Modular InverseThe number that undoes a multiplication modulo n, from the extended Euclidean algorithm — or the shared factor that proves no such number exists.
Chinese Remainder TheoremSolves a system of congruences including the moduli that are not coprime, which most tools refuse — with the merge shown one congruence at a time.
Simplify FractionsReduce a fraction to lowest terms with both routes to the divisor shown side by side — Euclid line by line and the shared primes — and a stated proof when nothing can be cancelled.
If you want the shared factor itself rather than a yes or no, the GCF Calculator gives the greatest common factor with the Euclidean steps that produced it.
Educational use disclaimer
This is an educational tool. The arithmetic is exact; gcd(0, 0) is undefined and the page says so rather than returning zero.
Published the coprime page reporting the pairwise condition separately from the set condition, because 6, 10 and 15 satisfy one and none of the other and the stronger one is what most applications need.
When the gcd exceeds 1 it is factorised, so the page names the primes that run through every value rather than just returning a number.
Euler's totient of the first value is given, since that count is exactly how many residues have a modular inverse.
Add this calculator to your site
Responsive embed — and private: nothing your visitors type leaves their browser.