Remainder / Modulo Calculator
Calculate the remainder or modulo of a division operation.
Runs locally in your browser
Your inputs are processed locally in your browser and are not uploaded or stored by us.
Calculates the truncated remainder using standard division.
The Remainder / Modulo Calculator quickly computes either truncating remainders or Euclidean modulos for exact integers.
How to use the calculator
- Select your calculation mode: Remainder or Modulo.
- Enter the dividend (the number being divided).
- Enter the divisor.
- Click "Calculate" to see the distinct result.
Mode Semantics
Remainder = dividend − trunc(dividend / divisor) × divisor
Modulo = ((dividend % modulus) + modulus) % modulus (where modulus = |divisor|)
Programming languages and mathematical texts can use different sign conventions for modulo. This calculator explicitly defines modulo as a non-negative result using the absolute value of the divisor. Therefore, remainder and modulo are not always identical for negative values.
Evaluating -7 divided by 3
Dividend-7
Divisor3
Remainder: -7 remainder 3 = -1
Modulo: -7 mod 3 = 2
Result: Remainder outputs -1, Modulo outputs 2
Notes
- Inputs must be safe integers, and the divisor cannot be zero (divisor != 0). Zero dividend is entirely valid.
- For Remainder: 7 remainder 3 = 1, -7 remainder 3 = -1.
- For Modulo: 7 mod 3 = 1, -7 mod 3 = 2, -7 mod -3 = 2.
- Decimal values are not supported in this exact-integer tool.
- The calculator preserves exact integer relationships within its documented limits.
- Your inputs are processed locally in your browser and are not uploaded or stored by us.