Modular Inverse Calculator
Modular inverse of a modulo m when gcd(a,m)=1. Same engine as Euclidean remainder. Not a second GCF page. Runs locally.
Enter values to calculate.
Trust summary CVP VERIFIED · CVP protocol 1.0.0-proposed · Core assurance · all published modes
- Input interpretation
- Enter values to calculate.
- Result
- —
- Verified scope
- all published modes
- Assurance
- Core
- Declared partition coverage
- PASS · 3/3 declared partitions (remainder, inverse, invalid-domain) · Matrix
- Known limitations
- Core CVP does not include live graph, viewport, or pointer interaction.
- Model
- x in [0, |m|) with a x ≡ 1 (mod m) when gcd(a,m)=1.
- Scope
- Integers
- Verification
- Engine tested · Specification checked · v1.1.0 · CVP VERIFIED · CVP protocol 1.0.0-proposed · Core assurance · all published modes· View Manifest · CVP overview · Specification
- Versions
- Calculation 1.1.0 · CVP protocol 1.0.0-proposed · Evidence 2026-09-22.discrete-algebra-cvp
- Verification revision
- 2026-09-22.discrete-algebra-cvp · 2/2 property · digest cde98c79d749
- Legacy regression
- 13/13 tests · Production surface contract 6/6
- Trust layers
- Verification VERIFIED · Production CURRENT · Overall CVP state: VERIFIED under CVP 1.0.0-proposed
- Reference
- O1 model · O2 expected_values · O2 numerical_behavior
- Interfaces
- PASS · UI (SSR) / REST / MCP
- Supplemental domain review
- Not performed
- Named expert review
- Not performed
- CVP suite
- 5/5 golden · 5/5 CVP boundary · 8/8 invalid · 2/2 property · 3/3 cross-interface · 1/1 cross-calculator · 6/6 CVP contract · Manifest
- Specification basis
- ISO 80000-2:2019 Quantities and units — Mathematics
- Knuth, The Art of Computer Programming, extended Euclidean algorithm
- Evidence
- 3 legacy golden · 4 legacy boundary · legacy regression suite · 5/5 oracle-backed golden · 8/8 invalid · Artifact integrity PASS
- Semantic contract
- PASS
Full verification
Formulas
Core equations used by this calculator.
How to use
Enter a and a modulus
|m| ≥ 2. Remainder still lives at /calc/math/modulo.
Read the inverse
If gcd ≠ 1 the engine returns NOT_INVERTIBLE. GCF is /calc/math/gcf.
Example calculations
Common configurations with formula and result.
3⁻¹ mod 11
3·4 = 12 ≡ 1
Not invertible
gcd(2,4)=2
Modular Inverse calculator specification
Version 1.1.0 · Engine tested
- Engine tested 13/13 tests · Production surface contract 6/6
- Named expert review Not performed
- Calculation version 1.1.0
- Definition
- x is a modular inverse of a modulo m when a x ≡ 1 (mod m). This page is mode=inverse on the modulo engine. Remainder and GCF are separate intents.
- What it calculates
- x in [0, |m|) with a x ≡ 1 (mod m) when gcd(a,m)=1.
- Inputs
- a
- modulus
- Outputs
- inverse
- gcd
- identity
- Formula
ax ≡ 1 (mod m)- Assumptions
- Integers
- Euclidean remainder convention
- |m| ≥ 2
- Not GCF
- Units
- dimensionless
- Boundary conditions
- gcd ≠ 1 → NOT_INVERTIBLE
- |m| < 2 → INVALID_INPUT
- modulus = 0 → DIVISION_BY_ZERO
- Example
- a=3 modulus=11 → inverse=4
- Validation cases
2 published on this page · 13/13 tests · Production surface contract 6/6 · View evidence
- a=3 modulus=11 → inverse=4
- a=2 modulus=4 → error NOT_INVERTIBLE
- Specification basis
- ISO 80000-2:2019 Quantities and units — Mathematics
- Knuth, The Art of Computer Programming, extended Euclidean algorithm
- Calculation version
- 1.1.0
Related tools
Other calculators in this family: Arithmetic Sequence Calculator, Factorial Calculator, Fibonacci Calculator, GCF Calculator, Geometric Sequence Calculator, LCM Calculator, Modulo Calculator, Permutation Combination Calculator . Explore all Number Theory & Discrete Math.
Frequently asked questions
Key distinctions behind the calculation.
Is this a second GCF calculator?
No. gcd is computed only to decide invertibility. GCF stays /calc/math/gcf.
Is this a second remainder page?
No. It is mode=inverse on math.modulo, the same engine as /calc/math/modulo.
Where does this run?
Locally in the browser by default. REST and MCP call the same modulo engine.