Math Last updated: July 2026

Chinese Remainder Theorem Calculator

Solve systems of simultaneous congruences using the Chinese Remainder Theorem. Enter your remainders and moduli to find the smallest non-negative integer satisfying all conditions.

How to Use the Chinese Remainder Theorem Calculator

Interactive calculator available after JavaScript loads.

Loading calculator...

Written by Calculator Archive Team

Math & Finance Experts — Verified Formulas, Peer-Reviewed Sources, Expert Analysis

Looking for a deeper explanation?

Read our comprehensive, peer-reviewed educational article in our Blog to learn the underlying math, formulas, and step-by-step examples.

Read Blog Guide ›

Mathematical Formula & Logic

Given pairwise coprime moduli n₁, n₂, ..., nₖ and remainders a₁, a₂, ..., aₖ, the solution is x = Σ(aᵢ × Mᵢ × yᵢ) mod N, where N = n₁ × n₂ × ... × nₖ, Mᵢ = N/nᵢ, and yᵢ = Mᵢ⁻¹ (mod nᵢ) is the modular inverse.
Variable Glossary
aᵢ The remainder for the i-th congruence
nᵢ The modulus for the i-th congruence (must be pairwise coprime)
N The product of all moduli: N = n₁ × n₂ × ... × nₖ
Mᵢ The partial product: Mᵢ = N / nᵢ
yᵢ The modular inverse of Mᵢ modulo nᵢ, satisfying Mᵢ × yᵢ ≡ 1 (mod nᵢ)

Step-by-Step Worked Calculation

Scenario: Solving x ≡ 2 (mod 3), x ≡ 3 (mod 5), x ≡ 2 (mod 7)

Find the smallest non-negative x satisfying all three congruences.

1

Step 1: Identify N = 3 × 5 × 7 = 105.

2

Step 2: Compute partial products: M₁ = 105/3 = 35, M₂ = 105/5 = 21, M₃ = 105/7 = 15.

3

Step 3: Find modular inverses: 35⁻¹ mod 3 = 2 (since 35×2=70≡1 mod 3), 21⁻¹ mod 5 = 1 (since 21×1=21≡1 mod 5), 15⁻¹ mod 7 = 1 (since 15×1=15≡1 mod 7).

4

Step 4: Compute x = (2×35×2 + 3×21×1 + 2×15×1) mod 105 = (140 + 63 + 30) mod 105 = 233 mod 105 = 23.

5

Step 5: Verify: 23 mod 3 = 2 —, 23 mod 5 = 3 —, 23 mod 7 = 2 —. The solution is x = 23.

How to Use the Chinese Remainder Theorem Calculator

  1. 1. Enter the number of congruences in your system (2 or more).
  2. 2. For each congruence, enter the remainder (aᵢ) and the modulus (nᵢ).
  3. 3. Ensure all moduli are pairwise coprime (GCD of any two moduli = 1) for a unique solution.
  4. 4. Review the solution x, the step-by-step computation, and the verification showing x ≡ aᵢ (mod nᵢ) for each equation.

What Is a Chinese Remainder Theorem Calculator?

Chinese Remainder Theorem Calculator is a mathematical computation tool that helps you solve systems of simultaneous congruences using the Chinese Remainder Theorem. Find the smallest non-negative solution with step-by-step verification. It applies established mathematical principles to deliver accurate results, often showing the underlying formula and step-by-step working so you can understand the computation process.

Why This Calculation Matters

Mathematical calculations form the foundation of science, engineering, finance, and everyday problem-solving. Chinese Remainder Theorem Calculator helps you work through calculations accurately and efficiently, reducing the risk of manual arithmetic errors. Whether you are a student learning concepts, a professional verifying work, or anyone needing quick and reliable math results, this tool ensures precision and saves time.

Historical Background

Mathematics has evolved over thousands of years, from ancient Babylonian clay tablets and Egyptian papyri to Greek formal proofs by Euclid and Archimedes. The development of algebra by Persian mathematician al-Khwarizmi in the 9th century and the invention of calculus by Newton and Leibniz in the 17th century laid the groundwork for modern computation. Chinese Remainder Theorem Calculator continues this tradition by making mathematical operations accessible through digital technology.

Frequently Asked Questions

Complete indexable directory of answers (3 questions)

What mathematical formula does the Chinese Remainder Theorem Calculator use?

The Chinese Remainder Theorem Calculator uses standard mathematical formulas validated against authoritative references. The specific formula is displayed in the calculator interface with a detailed explanation of each variable.

How can I verify the Chinese Remainder Theorem Calculator results manually?

Each calculator includes a step-by-step worked example showing exactly how the formula is applied. You can follow these steps with pen and paper to verify any result.

What types of inputs does the Chinese Remainder Theorem Calculator accept?

The Chinese Remainder Theorem Calculator accepts numeric inputs including integers and decimals. Invalid inputs (letters, special characters) are rejected with clear error messages.