Math · Number Theory

Modulo Calculator

Compute a mod b and get the remainder with quotient, sign rule applied consistently — including negative and large numbers.

a mod b
—
Definition: a = q·b + r, with 0 ≤ r < |b| for the Euclidean convention.
Examples: 17 mod 5 = 2  ·  (−17) mod 5 = 3  ·  17 mod (−5) = 2

Three conventions

Euclidean, floor and truncated remainders explained and computed.

Negative numbers

Clear handling of negative dividends and moduli.

Step-by-step

Shows the full a = q·b + r decomposition.

Big numbers

Works with large integers beyond typical float precision.

More Number Tools

Explore number theory and arithmetic calculators.