← Math & statistics

Modular Arithmetic Suite (Extended GCD, inverses, CRT)

Run extended Euclid, modular inverses, fast power, CRT merges, and linear congruences with BigInt precision, while How it’s calculated records every quotient, coefficient, and merge step for review.

Other languages 日本語 | English | 简体中文 | 繁體中文 | 繁體中文(香港) | Español | Español (México) | Português (Brasil) | Português (Portugal) | Bahasa Indonesia | Tiếng Việt | 한국어 | Français | Deutsch | Italiano | Русский | हिन्दी | العربية | বাংলা | اردو | Türkçe | ไทย | Polski | Filipino | Bahasa Melayu | فارسی | Nederlands | Українська | עברית | Čeština

The suite keeps a single state for extended Euclid, so you can confirm gcd, Bézout coefficients, inverses, or linear congruence solutions without retyping numbers. Fast power uses binary exponentiation logs, and CRT supports both coprime and non-coprime moduli with compatibility checks.

Each tool is screen-reader friendly via `role="status"` and `role="alert"`, while How it’s calculated tables export directly to CSV or shared URLs for lecture notes.

Inputs & tool selection

Results

How it’s calculated

    Table of intermediate steps

    Frequently asked questions

    What size of integers can I enter?

    Every field is parsed as a JavaScript BigInt, so you can work with negative values and very large integers. Only the modulus must be a positive integer.

    What appears in How it’s calculated?

    You will see the extended Euclid quotient table, the coefficients used for inverses, the res/base/exp trail for fast power, each CRT merge step, and the reduction path for linear congruences. All of it can be exported as CSV.

    Which mode should I use first?

    Use inverse when you need a number that multiplies to 1 modulo m, fast power for repeated exponentiation, CRT for compatible remainders, and extended GCD when you need the coefficients behind an inverse.

    Why can an inverse or CRT solution be missing?

    A modular inverse exists only when the number and modulus are coprime. CRT systems also need compatible congruences; otherwise there is no shared residue class.

    How should I verify a modular result?

    Substitute the result back into the original congruence and reduce both sides modulo the same positive modulus. The displayed Euclid or CRT steps show the same check in table form.

    How to use the modular arithmetic suite effectively

    Choose the congruence task

    Pick extended GCD for Bezout coefficients, inverse for division modulo m, fast power for large exponents, CRT for combined remainders, and linear congruence for equations of the form ax ≡ b.

    Use positive moduli

    Keep the modulus positive and reduce residues into the same range before comparing outputs. Negative inputs are accepted, but the final residue is easier to read when all comparisons use the same modulus.

    Use-case sequence

    Run extended GCD first when you are unsure whether an inverse exists. Then use the coefficient or gcd result to explain why the inverse, CRT merge, or linear congruence has a solution.

    Common mistakes to avoid

    Do not assume every number has an inverse, merge incompatible CRT rows, or compare residues under different moduli. Always check the gcd condition.

    Interpretation guidance

    A modular answer represents a residue class, not just one integer. Report the modulus with the answer so the same class can be verified later.