Chinese Remainder Theorem Calculator

Solve simultaneous congruences and find the least nonnegative solution with its repeat period.

Result
—

How to calculate

Combine two congruences using the extended Euclidean algorithm. The difference of their residues must be divisible by the GCD of their moduli. Continue merging one row at a time.

Worked example

Use Remainder and modulus on each line 2, 3 / 3, 5 / 2, 7. The result is x ≡ 23 (mod 105).

Input and result notes

Enter 2 to 12 lines, each with a residue followed by a modulus of at least 2. Compatible noncoprime moduli are supported.

Mount Royal University on linear congruences

Related calculators