Chinese Remainder Theorem Calculator — Solve a System of Congruences
Our Chinese Remainder Theorem Calculator solves systems of simultaneous congruences — x ≡ a₁ (mod m₁), x ≡ a₂ (mod m₂), and so on — finding the unique solution modulo the product of the moduli, provided the moduli are pairwise coprime. It validates coprimality up front and computes the solution with BigInt precision.
Quick Answer
Enter each congruence as remainder,modulus (one per line, at least two lines) to instantly solve the system for x via the Chinese Remainder Theorem's constructive method.
Enter at least two congruences, one per line, e.g. 2,3 for x ≡ 2 (mod 3). Moduli must be pairwise coprime.
How to Use the Chinese Remainder Theorem Calculator — Solve Modular Systems
- 1
Enter each congruence as "remainder,modulus" on its own line — at least two lines.
- 2
Click 'Calculate' to solve the system for x.
- 3
Review the combined modulus and the step-by-step construction of the solution.
Why Use Chinese Remainder Theorem Calculator — Solve Modular Systems?
The Chinese Remainder Theorem, first recorded by the Chinese mathematician Sun Tzu around the 3rd century AD, guarantees that a system of congruences with pairwise-coprime moduli has a unique solution modulo the product of those moduli — and gives an explicit constructive method to find it. This calculator validates that your moduli are actually pairwise coprime (the theorem's precondition) before combining the congruences via the standard construction, using each modulus's partial product and modular inverse.
Frequently Asked Questions
Related Tools
Extended Euclidean Algorithm Calculator — gcd + Bézout Coefficients
Compute gcd(a, b) and the Bézout coefficients x, y satisfying ax + by = gcd(a, b) using the extended Euclidean algorithm. Free calculator with BigInt precision.
Modular Multiplicative Inverse Calculator — Solve ax ≡ 1 (mod m)
Find the modular multiplicative inverse of a modulo m using the extended Euclidean algorithm. Free calculator with BigInt precision and existence check.
Primitive Root Calculator — Find a Generator mod n
Find the smallest primitive root modulo n — a generator of the multiplicative group mod n — with existence checking via Euler's totient function. Free calculator.