← All text tools

Modular Arithmetic Toolkit

Work modulo m: powers a^b mod m, sums and products, inverses, discrete logarithms, primitive roots, quadratic residues with square roots, and Legendre or Jacobi symbols.

  • Free
  • No sign-up
  • Works on any device

About Modular Arithmetic Toolkit

Pick an operation and the toolkit works in the integers modulo m. It computes a^b mod m by square-and-multiply with the table of steps, so 2^10 mod 1000 is 24, plus sums, products, inverses and quotients. It also finds discrete logarithms with the baby-step giant-step method, lists primitive roots (3 and 5 modulo 7) and the order of a, lists quadratic residues and square roots with Tonelli-Shanks for large primes, and evaluates Legendre and Jacobi symbols without factoring the modulus.

How to use Modular Arithmetic Toolkit

  1. Choose the operation, for example power, discrete logarithm or primitive roots.
  2. Enter a, b where needed, and the modulus m as whole numbers; very large values are accepted for powers and symbols.
  3. Read the result, the working table or steps and the check that confirms it.

Why use this tool?

Also known as

Frequently asked questions

What is a discrete logarithm?

It is the exponent x with a^x congruent to b modulo m, for example 3^4 = 81 = 13 modulo 17 so x = 4. There is no fast general method, which is why discrete logarithms underpin Diffie-Hellman key exchange.

What is a primitive root?

A number g whose powers produce every number coprime to m. Primitive roots exist only for m equal to 2, 4, an odd prime power or twice one. Modulo 7 they are 3 and 5.

What do the Legendre and Jacobi symbols tell me?

For an odd prime they are 1 when a is a non-zero square modulo the prime, -1 when it is not and 0 when the prime divides a. For composite odd moduli the Jacobi symbol -1 still proves a is not a square.

Is Modular Arithmetic Toolkit free?

Yes. Modular Arithmetic Toolkit on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put Modular Arithmetic Toolkit on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.