Free to use, no account

Chinese Remainder Theorem Calculator

Solve a system of modular congruences and see the least nonnegative solution with its combined modulus. Compatible non-coprime moduli work too; conflicting systems are explained.

Enter one congruence per line as remainder, modulus. Example: 2, 3 means x ≡ 2 (mod 3). You may also write x ≡ 2 (mod 3). Enter 2–20 lines.

Moduli must be integers of at least 2; entered values may be from −1,000,000,000,000 to 1,000,000,000,000. Compatible non-coprime moduli are supported. Some systems have no solution.

How do I use the Chinese remainder theorem calculator?

Enter one remainder and modulus on each line, separated by a comma, such as 2, 3 for x ≡ 2 (mod 3). Add 2–20 lines and calculate. The result gives the least nonnegative x and the combined modulus.

Frequently asked questions

How do I use the Chinese remainder theorem calculator?

Enter one remainder and modulus on each line, separated by a comma, such as 2, 3 for x ≡ 2 (mod 3). Add 2–20 lines and calculate. The result gives the least nonnegative x and the combined modulus.

Are my congruences uploaded?

No. The calculation runs in this browser with exact integer arithmetic. Your entered values are not uploaded or saved by this tool.

What does the Chinese remainder theorem find?

It combines congruences into a single repeating solution class. For example, x ≡ 2 (mod 3) and x ≡ 3 (mod 5) combine to x ≡ 8 (mod 15).

Can the moduli share a factor?

Yes, when the congruences agree modulo their greatest common divisor. For example, x ≡ 2 (mod 4) and x ≡ 6 (mod 8) combine to x ≡ 6 (mod 8). Conflicting systems are reported as having no solution.

Does this calculator use exact arithmetic?

Yes. It uses local BigInt integer arithmetic rather than floating-point numbers, within the input limits shown above.