Chinese Remainder Theorem Calculator
Solve three simultaneous congruences with pairwise coprime moduli.
About the Chinese Remainder Theorem Calculator
Chinese Remainder Theorem Examples
Each row combines three congruences into one residue class.
| Congruences | Solution | Explanation |
|---|---|---|
| 2 mod 3; 3 mod 5; 2 mod 7 | 23 mod 105 | Twenty-three leaves the requested three remainders. |
| 1 mod 4; 2 mod 5; 3 mod 7 | 17 mod 140 | The pairwise coprime moduli multiply to 140. |
| 0 mod 2; 1 mod 3; 4 mod 5 | 4 mod 30 | Four is the smallest nonnegative simultaneous solution. |
How to Solve Congruences
- Enter the integer remainder and modulus for the first congruence.
- Enter the second and third remainder-modulus pairs.
- Confirm that every pair of moduli has greatest common divisor one.
- Select Solve Congruences to find the unique residue class.
- Verify the answer by reducing it modulo each entered modulus.
Chinese Remainder Theorem FAQ
What does pairwise coprime mean?
Every distinct pair of moduli must have greatest common divisor one. The moduli themselves do not need to be prime numbers.
Why are there infinitely many solutions?
The theorem identifies one residue class modulo the product of all moduli. Adding any multiple of that product preserves every remainder.
Can a remainder be larger than its modulus?
Yes, it will reduce to an equivalent standard remainder. For example, remainder eight modulo five is equivalent to remainder three.
Can the theorem use negative remainders?
Yes, negative remainders represent valid residue classes and can be normalized. The displayed answer is the smallest nonnegative representative.
What happens when moduli are not coprime?
A solution may exist only when overlapping congruences are compatible. This calculator follows the classical pairwise-coprime theorem and reports those systems as unsupported.
How can I verify the CRT solution?
Divide the displayed solution by each modulus and inspect the remainder. Each remainder should match the corresponding input after modular reduction.