basic

Chinese Remainder Theorem Two Congruences Calculator

x ≡ a₁ (mod m₁), x ≡ a₂ (mod m₂) — CRT solution.

Solves a system of two linear congruences using the Chinese Remainder Theorem. Requires the user to provide the modular inverse of m₁ mod m₂ (for coprime moduli).

Published Last reviewed 1 min read

Inputs

Results

Enter values and click Calculate to see results.
Was this helpful?

How to use this calculator

  1. Fill in the inputs above using the units you already have.
  2. Values update automatically as you type — no submit button needed.
  3. Hover any result row for the underlying formula and intermediate values.

Formula

x = a₁ + m₁ × ((a₂−a₁) × inv(m₁,m₂) mod m₂); period = m₁×m₂

In depth

Solves a system of two linear congruences using the Chinese Remainder Theorem. Requires the user to provide the modular inverse of m₁ mod m₂ (for coprime moduli).