Modular Inverse

Computes the modular multiplicative inverse of a modulo m.

Input: TextResult: Text

Text input

Tool options

Examples

using input field for modulus

Input

17

Expected answer

JSON
7
Value (a)
5
Modulus (m)
(empty)
using input field for value

Input

5

Expected answer

JSON
21
Value (a)
(empty)
Modulus (m)
26
another coprime pair (7 mod 26)

Input

Expected answer

JSON
15
Value (a)
7
Modulus (m)
26
basic example (3 mod 11)

Input

Expected answer

JSON
4
Value (a)
3
Modulus (m)
11
hexadecimal input (0x10 mod 0x11)

Input

Expected answer

JSON
16
Value (a)
0x10
Modulus (m)
0x11
large number (RSA-like)

Input

Expected answer

JSON
934281398294
Value (a)
65537
Modulus (m)
9999999999999

Finds x such that a*x = 1 (mod m). Input handling: If either a or m is left blank, its value is taken from the Input field.

Format reference: Modular Inverse background and specification

Parameters

ParameterDefault valueInput and choices
Value (a)""Text
Modulus (m)""Text

Related tools

Browse arithmetic / logic tools