Canonical: https://toolipedia.app/modular-arithmetic-toolkit

# 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.

Breadcrumbs: Toolipedia > Online calculators > Maths and school calculators > Modular Arithmetic Toolkit

## 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?
- Private: everything happens in your browser. Nothing you enter is uploaded.
- Free, with no sign-up, no watermark and no limit on how often you use it.
- Works on phones, tablets and computers: Android, iPhone, Windows, Mac and Linux. Nothing to install.
- Free to embed on your own website, with a ready-made code to copy.

## Also known as
- modular arithmetic toolkit
- a^b mod m calculator
- discrete logarithm calculator
- primitive root calculator
- legendre symbol calculator
- jacobi symbol calculator

## 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.

## Related tools

More free tools that go well with Modular Arithmetic Toolkit:
- [Modular inverse calculator](https://toolipedia.app/modular-inverse-calculator)
- [Arithmetic sequence calculator](https://toolipedia.app/arithmetic-sequence-calculator)
- [Exponent and log calculator](https://toolipedia.app/exponent-calculator)
- [Modulo calculator](https://toolipedia.app/modulo-calculator)
- [Discrete Fourier Transform and Convolution Calculator](https://toolipedia.app/discrete-fourier-transform-and-convolution)
