Modulo Calculator

Calculate the modulo — the remainder after division.

What's left over

The modulo operation gives the remainder after one number is divided by another — 17 modulo 5 is 2, because 17 divided by 5 leaves 2 over. This calculates it, a deceptively simple operation that is everywhere in computing and number theory.

Enter two numbers to find the modulo.

Why the remainder is so useful

Modulo is far more useful than it looks. It is how you test divisibility — a number is even if it is zero modulo two, divisible by anything if the remainder is zero. It is how clocks work: adding hours wraps around at twelve, which is modulo arithmetic, and the same idea handles days of the week and any cyclic pattern. In programming it is used constantly, to cycle through a list, alternate between options, or distribute items evenly. It even underlies parts of cryptography. The whole power comes from that one idea of wrapping around after reaching a limit, which turns out to model an enormous range of repeating, cyclic situations.

Questions & answers

What does modulo calculate?

The remainder after division — 17 modulo 5 is 2, because 5 goes into 17 three times with 2 left over.

Where is modulo used?

Testing divisibility, clock and calendar arithmetic that wraps around, cycling through lists in programming, and parts of cryptography.

Is anything uploaded?

No. The calculation happens in your browser.

More Math tools