About the Modulo Calculator
Modulo gives the remainder after division, but negative numbers cause confusion: −17 mod 5 is 3 in mathematics, while −17 % 5 is −2 in C, Java and JavaScript. This calculator shows both.
You also get the floor quotient and the full equation a = q × n + r, so you can check the result.
How to use the Modulo Calculator
- Enter the dividend a.
- Enter the divisor n.
- Read the modulo, remainder and quotient.
Features
- What if…? explorer: change one number and see the answer for a whole range of values, with bars
- Mathematical modulo
- Truncated remainder (%)
- Floor quotient
- Works with decimals
Supported formats
- Numbers
Frequently asked questions
Which one does Python use?
Python’s % returns the mathematical (floored) result, so −17 % 5 is 3 in Python.
Are my numbers saved?
No. Calculations happen in your browser and nothing you enter is sent anywhere or stored.
Added · Last reviewed · Maintained by Sohail Khax · How we test tools