← All text tools

Modulo calculator

Find a mod n, the quotient and the remainder, for positive and negative numbers.

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

About Modulo calculator

Gives a mod n along with the quotient and remainder. It is the engine behind clock arithmetic, checking whether a number is even, and wrapping array indexes. Negative numbers are where tools disagree: this one shows how the remainder behaves so -7 mod 3 is not a surprise.

How to use Modulo calculator

  1. Enter the dividend, the number a.
  2. Enter the divisor n.
  3. Read a mod n along with the quotient and remainder.

Why use this tool?

Also known as

Frequently asked questions

What is -7 mod 3?

With the mathematical convention, where the result takes the sign of the divisor, it is 2, because -7 = 3 x (-3) + 2. Some programming languages return -1 instead.

Why do some calculators give a different answer for negative numbers?

Languages differ: some give a remainder with the sign of the dividend, others a result between 0 and n minus 1. Check which convention you need for your code or class.

What is modulo used for in everyday tasks?

It tells you if a number is even or odd (mod 2), wraps values around a clock (mod 12), and cycles through items in a list in programming.

Is Modulo calculator free?

Yes. Modulo calculator 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 Modulo calculator 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