Vol. I a living index of named laws · est. mmxxvi no ads · no account
The Law Tomeindex of named laws

The Chinese Remainder Theorem

also known as — CRT, Sunzi's theorem
"If you know a number's remainders on division by several coprime moduli, those remainders pin it down uniquely."
In plain English

What does The Chinese Remainder Theorem mean?

The Chinese remainder theorem says that if you are told the remainders of an unknown whole number when divided by several moduli that are pairwise coprime, sharing no common factor, then there is exactly one solution modulo the product of those moduli. In other words, a system of simultaneous congruences with coprime moduli always has a solution, and that solution is unique up to adding multiples of the product. Named for its appearance in the third-to-fifth-century Chinese text Sunzi Suanjing, it is a foundational result of number theory and modular arithmetic, letting one reconstruct a number from its residues and reassemble modular calculations done separately for each modulus.

Solve one

The Chinese Remainder Theorem solver

Give the remainders and the moduli. If the moduli are pairwise coprime there is exactly one answer below their product, and the construction finds it.

x = sum(ri Ni yi) mod N, N = product of the mi

ri
The remainder you want
mi
The modulus, pairwise coprime with the others
N
Product of all the moduli

The moduli must be pairwise coprime. When they are not, the theorem does not apply and this says so rather than returning a number.

Reliability

Rated Empirical: grounded in studies or measurable evidence. The other 608.

How it works

How does The Chinese Remainder Theorem work?

The heart of the theorem is that reducing a number modulo a product of pairwise-coprime moduli carries the same information as reducing it modulo each factor separately, and these residues can be recombined. Constructively, for each modulus one builds a number that is one modulo that factor and zero modulo the others, using the fact that coprime moduli admit combinations via Bezout's identity, then sums the pieces weighted by the required remainders. In the language of abstract algebra, the ring of integers modulo the product is isomorphic to the direct product of the rings modulo each factor, so the theorem is an isomorphism that decomposes a complicated modulus into simple independent pieces.

Figure illustrating The Chinese Remainder Theorem
The Chinese Remainder Theorem — Cmglee · CC BY-SA 4.0 · source
Where you'll see it

What are examples of The Chinese Remainder Theorem?

Sunzi's puzzle The classic problem asks for a number leaving remainder two modulo three, three modulo five, and two modulo seven; the unique answer modulo one hundred and five is twenty-three.
Fast big-number arithmetic Computers split a huge modular computation into independent pieces modulo small coprime factors and recombine, the residue number system used to speed up cryptography like RSA.
Qin Jiushao's general method The thirteenth-century mathematician Qin Jiushao gave a complete general algorithm in his 1247 Mathematical Treatise in Nine Sections, the Dayan aggregation method.
Types & variants

What are the types of The Chinese Remainder Theorem?

The ring-isomorphism form§

The abstract statement that the integers modulo a product of coprime numbers factor as the direct product of the integers modulo each, generalising to any commutative ring with coprime ideals.

Non-coprime systems§

When moduli share factors, a solution exists only if the given remainders agree on the common parts, and then it is unique modulo the least common multiple.

Why it matters

Why does The Chinese Remainder Theorem matter?

The Chinese remainder theorem is a cornerstone of number theory and a workhorse of computation, letting a problem modulo a large number be broken into independent problems modulo its coprime factors and reassembled. It speeds up arithmetic in cryptography and error-correcting codes, underlies secret-sharing schemes, and appears throughout algebra as a structural decomposition of rings. Historically it records a remarkably early insight, from calendar and astronomy calculations in ancient China, and it remains a standard tool whenever numbers are handled through their remainders, from fast RSA decryption to the design of hash functions.

Working with it

How do you apply The Chinese Remainder Theorem?

  • Split by coprime moduli — reduce a hard calculation modulo a big number into separate calculations modulo its pairwise-coprime factors, solved independently.
  • Reassemble the residues — combine the per-factor answers into the unique solution modulo the product, using coprimality to weight each piece correctly.
  • Check compatibility if not coprime — when moduli share factors, first confirm the remainders agree on the overlap; only then is there a solution, unique modulo the least common multiple.
Where it breaks down

What are the limits of The Chinese Remainder Theorem?

The clean existence-and-uniqueness guarantee requires the moduli to be pairwise coprime; without that, a system may have no solution at all, and when it does the solution is unique only modulo the least common multiple rather than the product. The theorem tells you a unique residue exists but, in its pure form, is a statement about remainders, not about the size of the smallest positive solution. Its computational payoff also depends on the moduli genuinely being coprime and on the cost of the recombination step, which uses modular inverses that must themselves be computed.

What it doesn't say

What are common misconceptions about The Chinese Remainder Theorem?

The theorem does not require the moduli to be prime, only pairwise coprime, so composite moduli are fine as long as they share no common factor. It is not a Chinese-only result despite the name; the name reflects the early appearance in Sunzi's manual, while the general method is due to Qin Jiushao and, in Europe, Gauss. And uniqueness is modular, not absolute: there are infinitely many integer solutions, all congruent modulo the product of the moduli, with the theorem singling out one residue class rather than one number.

Is it real?

Is The Chinese Remainder Theorem real?

Yes, as far as the evidence goes. The Chinese Remainder Theorem is rated Empirical here: it rests on studies or measurements rather than on a saying.

Rated from two sources. 609 of the 1,116 entries carry this rating. How the scale works.

Regularly printedin printed books: one of 144 names in its band, of 903 measured
38 of 51entries in mathematics & proof carry the same rating

The best-known laws are the least likely to rest on measurement.

Origin

Where did The Chinese Remainder Theorem come from?

First recorded as a specific puzzle in Sunzi Suanjing between the third and fifth centuries, given a complete general algorithm by Qin Jiushao in his 1247 Mathematical Treatise in Nine Sections, and set on modern foundations by Gauss in his Disquisitiones Arithmeticae of 1801.

How the name spread

When did people start saying “The Chinese Remainder Theorem”?

18002019
How often “Chinese Remainder Theorem” appears in printed English, which takes hold around 1960 and peaks around 2002. This tracks the phrase and not the idea. A law is usually older than the name for it. Source: Google Books Ngrams.
Known elsewhere as

What is The Chinese Remainder Theorem called in other languages?

  • Arabicمبرهنة الباقي الصيني
  • Germanchinesischer Restsatz
  • Spanishteorema chino del resto
  • Frenchthéorème des restes chinois
  • Hindiचीनी शेष प्रमेय
  • Italianteorema cinese del resto
  • Japanese中国の剰余定理
  • Portugueseteorema chinês do resto
  • Russianкитайская теорема об остатках
  • Chinese中国剩余定理

10 languages, as recorded on Wikidata. These are names the idea already goes by, not translations we made. The whole index by language.

Sources

Sources & further reading

  1. 1Chinese remainder theorem, Wikipedia. — the statement for coprime moduli, the Sunzi puzzle answer 23, and Qin Jiushao's general algorithm.secondary
  2. 2Chinese Remainder Theorem, Wolfram MathWorld. — the simultaneous-congruence statement and the ring-isomorphism form.secondary

Everything above traces to en.wikipedia.org and mathworld.wolfram.com: two secondary sources, accounts of the original rather than the original itself, which has not been located for this entry. Nothing is written from memory, and the method is written down. Spot an error or a better source? Suggest a fix.

What we checked

  • 1,116entries in the tomeListed one by one on the browse page.
  • 1,116of them citing a sourceOpen any entry: its sources sit at the foot of the page.
  • 2,489source references in allEach is named, and linked wherever the source is online.