Modulo Calculator

Calculate a mod b, view the integer quotient, and compare remainder handling for positive or negative inputs.

This tool expects integers. It shows both the raw remainder and a normalized modulo value.

Result will appear here.
Metric Value

Privacy: calculations run locally in your browser. No values are stored or transmitted.

How it works

Division relationship:
a = b × q + r
where q is the integer quotient and r is the remainder or modulo value.

Examples

  • 17 mod 5 = 2
  • 20 mod 4 = 0
  • -17 mod 5 normalized = 3

FAQ

  • What does modulo mean?

    Modulo gives the remainder after division. For example, 17 mod 5 = 2.

  • What happens if the divisor is 0?

    Modulo by zero is undefined, so the calculator will show an error.

  • How are negative values handled here?

    This tool shows both the JavaScript remainder and a normalized modulo value based on the absolute divisor.

  • Are calculations stored?

    No. Everything runs locally in your browser.

Related tools