Chinese Remainder Solver Calculator

Compute linked congruences with accurate merged modular results. Review steps, detect conflicts, and export summaries. Built for classes, proofs, checks, puzzles, and engineering work.

Calculator

Enter at least two congruences. Negative remainders are allowed. Moduli must be positive integers.

Equation 1
Equation 2
Equation 3
Reset

Example data table

This classic system produces x = 23 and repeats every 105.

Equation Remainder Modulus Statement Check at x = 23
1 2 3 x ≡ 2 (mod 3) 23 mod 3 = 2
2 3 5 x ≡ 3 (mod 5) 23 mod 5 = 3
3 2 7 x ≡ 2 (mod 7) 23 mod 7 = 2
Solution family: x = 23 + 105k

Formula used

Standard CRT form:
x ≡ a₁ (mod m₁), x ≡ a₂ (mod m₂), ..., x ≡ aₙ (mod mₙ)
Pairwise coprime shortcut:
N = m₁m₂...mₙ, Nᵢ = N / mᵢ, and Mᵢ = inverse of Nᵢ modulo mᵢ
x ≡ Σ(aᵢNᵢMᵢ) (mod N)
Generalized merge rule:
Merge x ≡ a (mod m) with x ≡ b (mod n). Let g = gcd(m, n).
A solution exists only when (b − a) is divisible by g.
Then solve:
(m/g)t ≡ (b − a)/g (mod n/g)
and set:
x = a + mt
New modulus = lcm(m, n) = mn/g

This calculator uses the generalized merge method, so it can solve pairwise coprime systems and also compatible systems with shared factors.

How to use this calculator

  1. Enter one remainder and one positive modulus for each congruence.
  2. Add more rows if your system has extra equations.
  3. Choose the graph start and end integers.
  4. Press Solve system to compute the least solution.
  5. Review the merged modulus, step log, and verification table.
  6. Use the CSV or PDF buttons to save your result summary.

FAQs

1) What does this solver calculate?

It finds an integer x that satisfies several modular equations at the same time. When a solution exists, it also returns the repeating solution family and the combined modulus.

2) Do the moduli have to be pairwise coprime?

No. This version also handles shared factors. A solution still exists when the difference between linked remainders is divisible by the gcd of the related moduli.

3) Why are negative remainders accepted?

A negative remainder can be rewritten as an equivalent positive residue modulo the same modulus. The calculator normalizes every remainder before solving the full system.

4) What is the least non-negative solution?

It is the smallest solution x with x ≥ 0. Every other solution is found by adding integer multiples of the combined modulus to that value.

5) What does the combined modulus mean?

It is the repeat period of the full solution family. For solvable systems, all valid answers differ by this modulus, so the pattern repeats forever along the number line.

6) Why might the system have no solution?

A conflict appears when two congruences demand incompatible residues. In generalized CRT terms, the remainder difference fails the divisibility test against the gcd of the involved moduli.

7) What does the graph show?

For solvable systems, the graph marks every integer in your chosen range that belongs to the solution family. For incompatible systems, it displays normalized remainders for quick inspection.

8) Can I use this for teaching and proof checking?

Yes. The step log, verification table, and formula section make it useful for classroom demonstrations, homework checking, coding tasks, and modular arithmetic practice.

Related Calculators

Modular Exponentiation Fast Power CalculatorReverse Euclidean algorithm calculatorfast modular exponentiation calculatorLarge number modulo calculatormodular congruence solverpisano period calculatoreuler totient calculatorgcd calculatorprime number checkercommon multiples calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.