Generalized Chinese Remainder Calculator
Find the complete integer solution class for simultaneous congruences, including compatible non-coprime moduli.
YOUR CALCULATION
Result
—
Calculation steps
Work through one step at a time or reveal the complete calculation. The steps use your current inputs.
How to calculate
Merge one congruence at a time using a gcd compatibility check and an extended-Euclidean modular inverse. Reduce the result into the combined least-common-multiple period.
Compatibility requires gcd(m,n) to divide the residue difference; combined period=lcm(m,n)
Worked example
x≡2 mod3, x≡3 mod5, x≡2 mod7 gives x≡23 mod105. Compatible non-coprime x≡2 mod4 and x≡6 mod8 give x≡6 mod8.
Assumptions and input details
One to twenty rows, signed integer residues and positive integer moduli, each at most 50 decimal digits. Combined solution period is limited to 500 digits. Arithmetic is exact. Inconsistent valid constraints return no solution; they are distinct from malformed input. Repeated or modulus-one constraints are supported. The result describes every solution as residue plus any integer multiple of the period, not only a single positive value.
Using this calculator
Can I enter my own problem?
Yes. Replace the example values with your own inputs. The result, calculation steps, tables and applicable diagrams update from those inputs. Blank or invalid values clear the result; example values are never silently substituted for missing inputs.
Are the results exact?
Residues, congruence solutions, quota comparisons and final allocations use exact integer arithmetic. Decimal quota displays, if present, are approximate; read the documented input and tie rules.
Is my input uploaded?
The calculation runs in your browser. No account, file upload or external AI service is required. Inputs are not saved between page reloads.
Calculate a large integer power modulo a positive integer without constructing the full power.
Find the exact greatest common divisor and least common multiple of 2–20 integers. Inspect progressive reductions, divisibility checks and Euclidean division steps.
Encode a decimal value as a binary32 pattern or decode a 32-bit hexadecimal word, including signed zero, subnormals and special values.
Reserved advertising space.