Skip to main content

Numbers, Units & Calculators

Modular Inverse Calculator

Calculate a result with Modular Inverse from the values you enter. Enter the required values, adjust the options, and review the calculated result.

Tool workspace

Your input stays in this browser.

Add the required input to continue.

Needs input

You can run the tool again after any change.

Options

Your result appears here

Calculate a result with Modular Inverse from the values you enter. Enter the required values, adjust the options, and review the calculated result.

This tool runs open-source code from CyberChef by GCHQ (Apache License 2.0). See open-source credits.

Modular Inverse Calculator finds x where a×x equals 1 modulo m.

It returns 4 because 3×4 mod 11 equals 1. The calculation runs in your browser. Processing runs in the browser.

Instructions

  1. Provide values for this tool.
  2. Enter a and modulus m.
  3. Check that an inverse exists.
  4. Verify a×x modulo m.

Example

Input: a = 3; m = 11

Settings: Modular Inverse Calculator: Value a: 3; modulus m: 11.

Result: It returns 4 because 3×4 mod 11 equals 1.

Limits

  • Modular Inverse Calculator: An inverse exists only when a and m are coprime.
  • Modular Inverse Calculator: Inputs must use the accepted integer form.
  • Modular Inverse Calculator: It does not factor large numbers for you.