Chinese Remainder Theorem Calculator

Enter two or three congruences to find the unique solution modulo the product of the moduli.

How to use

  1. Enter your values in the fields above.
  2. Press Calculate to see your result instantly.
  3. Use the Share button to copy a link to your result.

About this calculator

The Chinese Remainder Theorem says that if you know the remainder of an unknown number x when divided by several moduli that are pairwise coprime (no two of them share a common factor), then there is exactly one value of x, modulo the product of all those moduli, that satisfies every congruence x ≡ r (mod m) simultaneously. The theorem takes its name from an old Chinese mathematics text that posed the puzzle of counting a group of soldiers using their remainders when lined up in rows of different sizes.

Beyond the classic puzzle, CRT is genuinely load-bearing in modern computing: RSA implementations use it to speed up private-key decryption by working modulo each prime factor separately and recombining the results, and it underlies calendar arithmetic, certain error-detecting codes, and hashing schemes that split a large modulus into smaller coprime pieces.

This calculator takes two or three congruences x ≡ r (mod m), checks that the moduli are pairwise coprime, and returns the unique solution modulo their product — along with the working so you can see how it was combined.

Was this helpful?

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators