Home · Everyday · Bases, Binary & Logic · Chinese Remainder Theorem Calculator
Chinese Remainder Theorem Calculator
Solve a system of congruences with the Chinese remainder theorem — one answer modulo the product.
What this calculator does
Solve a system of congruences with the Chinese remainder theorem — one answer modulo the product. Where a measure is involved, US and metric units are both accepted — flip the unit toggle and the figures convert with the same definitions the formula uses. Every result on this page is computed from the formula stated below, with no hidden rounding steps.
The formula and method
The moduli must be pairwise coprime; then a solution exists and is unique modulo their product.
The solution is built one congruence at a time with modular inverses.
The smallest non-negative solution is reported.
Worked example
With the example inputs this page opens with, the result is 8 — smallest non-negative solution. The Chinese remainder theorem: because the moduli are pairwise coprime, the system has exactly one solution modulo M = 15. Each term aᵢ·Mᵢ·(Mᵢ⁻¹ mod mᵢ) contributes its remainder and vanishes modulo the other moduli.
Quick reference
| Figure | Value |
|---|---|
| Smallest non-negative solution | 8 |
| Combined modulus M | 15 |
| Terms summed | 2 × 5 × 2 + 3 × 3 × 2 |
| Check | x mod 3 = 2, x mod 5 = 3 |
Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.
Common questions
How does the Chinese Remainder Theorem Calculator work?
Solve a system of congruences with the Chinese remainder theorem — one answer modulo the product. Remainders · Moduli → Solution. The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.
What inputs does the Chinese Remainder Theorem Calculator need?
Remainders · Moduli → Solution. Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.
Is the Chinese Remainder Theorem Calculator free to use?
Yes. It runs entirely in your browser with no sign-up, and the same calculator is available as an embeddable widget via the Embed button, so it can be placed on another site with its calculation intact.