Chinese Remainder Theorem Calculator

Solve x ≡ a (mod m) and x ≡ b (mod n) for coprime moduli.

Smallest solution x 8
Combined modulus (m·n) 15

Formula: x ≡ a (mod m), x ≡ b (mod n), gcd(m,n)=1

Step-by-step with your numbers:
1. Values used:
2. Remainder a = 2
3. Modulus m = 3
4. Remainder b = 3
5. Modulus n = 5
6.
7. Smallest solution x = 8
8. Combined modulus (m·n) = 15
Did we solve your problem today?

The Chinese Remainder Theorem combines two modular conditions into a single one when the moduli are coprime.

The math behind it

If gcd(m, n) = 1, there is exactly one solution modulo m·n. This tool searches that range for the smallest non-negative x.

Worked example

x ≡ 2 (mod 3) and x ≡ 3 (mod 5) → x = 8 (mod 15).

FAQ

What if the moduli share a factor?

The theorem's uniqueness no longer applies; a solution exists only if the remainders are consistent.