Modulo Calculator

Compute a mod n with quotient and remainder under truncated, floored, and Euclidean conventions, including negative inputs.

Frequently Asked Questions

What does modulo mean?

a mod n is the remainder after dividing a by n. 17 mod 5 = 2. It answers "what is left over" and is central to clock arithmetic, hashing, and parity.

How are negative numbers handled?

Conventions differ: truncated (follows the sign of a, like JavaScript %), floored (follows the sign of n), and Euclidean (always non-negative). The tool shows the result for the selected convention.

What is modulo used for?

Even/odd tests (x mod 2), cycling through arrays, days-of-week math, check digits, cryptography, and hashing. Any "wrap-around" problem is modulo.

Is mod the same as the remainder operator?

For positive operands, yes. For negatives they can differ - many languages' % is the truncated remainder, while "mod" in math is usually the floored or Euclidean result.

Important Disclaimer: Estimates for informational purposes only.

This calculator provides estimates for informational purposes only. Results are based on assumptions and may not reflect actual outcomes. Consult qualified professionals in relevant fields before making important decisions based on these results.