Modulo Calculator


This online Modulo Calculator performs the modulo operation on integer numbers by Euclidean division. The input numbers, both dividend and divisor, can be positive or negative.


x mod y = r

Dividend (x):
Divisor (y):

Remainder (r):


Modulo operation

In mathematics, the result of the modulo operation is the remainder \(r\) from the Euclidean division of a number \(x\) (the dividend) by a number \(y\) (the divisor). The most commonly used definition of modulo operation on integer numbers, implemented in our Modulo Calculator, is expressed by the following modulo formula:

$$r=x-|y|\left\lfloor {\frac {\left|x\right|}{\left|y\right|}}\right\rfloor$$

where the special brackets denote the floor function. According to this definition the remainder is always not negative. The modulo operation is usually expressed in the form of the equation

$$x\kern 0.3em mod\kern 0.3em y\kern 0.3em=\kern 0.3emr.$$

The most famous application of modular arithmetic is what’s referred to as “clock arithmetic”. Let’s see an example and assume it’s late at night, say 11 PM. You want to know what time you should wake up in the morning so you can get 8 full hours of sleep. You can’t just add 8 to 11, as there’s no such thing as 19 AM. In this case you need to perform a modulo operation (mod 12). You just add these two numbers, and keep subtracting 12 from the sum until you get a number lower than 12. In this case it’s 7, which means that you should wake up at 7 AM.

Another use of a modular arithmetic calculator is in computation of checksums for serial numbers. For example, International Bank Accounts Numbers (or IBAN) utilize modulo 97 to check if a client typed the number correctly. Also IS4SN and ISBN numbers, which are distinct book and periodic identifiers, have either modulo 10 or modulo 11. The modular arithmetic is also used in different types of scientific areas like cryptography, computer algebra and computer science.


Related calculators

Check out our other math calculators such as Factoring Calculator and Greatest Common Divisor Calculator.