UTILS.
Private by default
mod

Modulo Calculator

Compute a mod n: the JS remainder, the always-positive modulo, the quotient and divisibility.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

About this tool

Enter a and n to compute a mod n. It shows both the JavaScript remainder (whose sign follows a) and the mathematical modulo (always non-negative), the quotient, and whether a is divisible by n. It uses BigInt so very large integers and negatives are exact — all in your browser.

Frequently asked questions

Why are there two modulo results?
JavaScript's % operator keeps the sign of the dividend, so -7 % 5 is -2, while the mathematical modulo is always non-negative, giving 3. Both are shown.
Does it handle very large numbers?
Yes. Inputs are parsed as BigInt, so arbitrarily large integers and negatives are handled exactly without rounding.

More tools