Skip to main content
Calcimator

Chinese Remainder Theorem Calculator

Solve systems of congruences using the Chinese Remainder Theorem. Find x such that x ≡ r1 (mod m1) and x ≡ r2 (mod m2).

Inputs

Results

Solution (x)

8

Combined Modulus15
Verification8 mod 3 = 2, 8 mod 5 = 3
How to Use This Calculator
  1. Enter Remainder 1 (r₁), Modulus 1 (m₁), and Remainder 2 (r₂).
  2. Set Modulus 2 (m₂).
  3. Review the Solution (x) result.
  4. Use Combined Modulus and Verification to inform your decision.
  5. Use the chart to visualize the results and explore different scenarios by adjusting inputs.

What each input means

Remainder 1 (r₁)
First remainder: x ≡ r₁ (mod m₁)
Modulus 1 (m₁)
First modulus
Remainder 2 (r₂)
Second remainder: x ≡ r₂ (mod m₂)
Modulus 2 (m₂)
Second modulus

How this is calculated

Worked example, using the default values

  1. Identify Input Parameters
    4 parameters
    Remainder 1 (r₁) = 2, Modulus 1 (m₁) = 3, Remainder 2 (r₂) = 3, Modulus 2 (m₂) = 5 = 4 input(s) provided
  2. Calculate Solution
    8 = 8
  3. Calculate Combined Modulus
    15 = 15
  4. Calculate Verification
    Verification
    8 mod 3 = 2, 8 mod 5 = 3 = 8 mod 3 = 2, 8 mod 5 = 3

Engine last updated . Checked against 3 independently-derived tests how we verify calculators.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Math & Statistics.