Modulo Calculator
This calculator finds a mod n, the remainder after division. It shows both the mathematical result, which is never negative, and the remainder with the sign of a, as many programming languages give.
- Free, no sign-up
- Nothing is sent to a server
- Worldwide
How to use Modulo Calculator online
- Type the dividend. Enter a, the number to divide.
- Type the divisor. Enter n, which must not be 0.
- Read both remainders. The mathematical mod and the programming remainder appear.
- Check the sum. The check line shows a = n × quotient + remainder.
Why use this free Modulo Calculator
- Mathematical mod
- Programming remainder
- Both quotients
- Check line
- Negative numbers
- Share by link
The remainder
When you divide a whole number a by n, you get a quotient and a remainder: a = n × quotient + remainder. The modulo operation returns that remainder. It is used for clock arithmetic, for finding whether a number is even, for wrapping around in arrays and for checking divisibility.
Two conventions
For positive numbers all definitions agree. For negative numbers they differ. In mathematics a mod n is never negative, so −7 mod 3 is 2. Languages such as JavaScript, C and Java give the remainder the sign of a, so −7 % 3 is −1. The page shows both and the matching quotients.
A worked example
For a = −7 and n = 3, the mathematical result is 2, with a quotient rounded down of -3. The programming remainder is -1, with the quotient cut towards zero, which is -2. The check line reads -7 = 3 × -3 + 2.
Everyday uses
Hours on a clock use mod 12 or mod 24. Days of the week repeat every 7 days, so mod 7 gives the weekday shift. Hash tables, checksums and repeating patterns also depend on it.
Rules
The divisor cannot be 0. The page accepts whole numbers, positive or negative, up to about 10^15 in size.
Using the calculator
The Modulo Calculator recalculates whenever a box changes, so you can try several cases quickly. Copy the result, download a PDF or a CSV, or send the page link.
Modulo Calculator: frequently asked questions
What is −7 mod 3?
How do I tell if a number is even?
Can the divisor be negative?
What is a mod n used for?
Why does the page show two answers?
Are my Modulo Calculator entries sent anywhere?
Is there a way to keep the Modulo Calculator result?
Related searches for Modulo Calculator
- Modulo Calculator online
- free Modulo Calculator
- Modulo Calculator online free
- Modulo Calculator for mobile
- Modulo Calculator without sign up
- modulo formula
- modulo calculator with table
- Modulo Calculator – Student & Math
Modulo Calculator is a free online tool on MAITBOX, in the Student & Math group. It runs in your browser, so what you type is not sent to a server. It works on Android and iPhone, and on Windows, Mac and Linux, with no download and no account.