Modulo Calculator

Find a mod b — the remainder after division.

How to use the Modulo Calculator

  1. Enter or choose the a.
  2. Enter or choose the b (modulus).
  3. Results update instantly as you type — press Calculate any time to refresh.

Formula

a mod b = a − b × floor(a ÷ b).

About this calculator

The modulo operation finds the remainder after division. It is used in programming, clock arithmetic, cryptography and checking divisibility.

Frequently asked questions

Why does −7 mod 3 give 2?

Mathematical modulo always returns a non-negative result for positive b; many programming languages return −1 instead.