Binary Modulo Calculator
Calculate the remainder of binary division instantly with BinaryCon’s Binary Modulo Calculator. Enter a binary dividend and modulus to get the exact binary remainder, quotient, decimal verification, and a clear division check.
What Is Binary Modulo?
Binary modulo calculates the remainder left after dividing one binary integer
by another. The operation is usually written using mod or the
percent symbol %.
The underlying arithmetic is the same as decimal modulo; only the number representation is different.
Binary Modulo Formula
Modulo is directly related to integer division. For dividend A and divisor B:
For a positive divisor, the remainder is always smaller than the divisor.
How to Calculate Binary Modulo
1. Identify the dividend
The dividend is the binary number being divided.
2. Identify the modulus
The second binary value acts as the divisor.
3. Perform integer division
Find how many whole times the divisor fits into the dividend.
4. Multiply back
Multiply the binary quotient by the divisor.
5. Subtract
Subtract that product from the original dividend.
6. Read the remainder
The leftover binary value is the modulo result.
Example: 110110 mod 101
Let’s calculate the modulo of binary 110110 by binary
101.
Example: 1010 mod 11
When Is Binary Modulo Equal to Zero?
The modulo result is zero when the dividend is exactly divisible by the modulus.
What If the Dividend Is Smaller Than the Modulus?
If a non-negative dividend is smaller than the positive modulus, the divisor does not fit even once. The quotient is zero and the original dividend becomes the remainder.
Binary Modulo by 1
Every non-negative integer modulo 1 is zero because every integer is exactly divisible by 1.
Why Is Modulo by Zero Invalid?
Modulo depends on division. Since division by zero is undefined, modulo zero is also undefined.
0.
Binary Modulo and Powers of Two
For non-negative binary integers, modulo by a power of two has a useful bit-level interpretation.
If the modulus is 2^n, the remainder is determined by the
lowest n binary bits.
| Modulus | Decimal | Relevant Low Bits |
|---|---|---|
10₂ |
2 | Lowest 1 bit |
100₂ |
4 | Lowest 2 bits |
1000₂ |
8 | Lowest 3 bits |
10000₂ |
16 | Lowest 4 bits |
Example: Modulo by Binary 1000
Binary 1000 equals decimal 8. For a non-negative integer, modulo
8 is represented by the lowest three bits.
Binary Modulo vs Binary Division
| Operation | Main Result | Example |
|---|---|---|
| Binary Division | Quotient and remainder | 1010 ÷ 11 = 11 remainder 1 |
| Binary Modulo | Remainder only | 1010 mod 11 = 1 |
The modulo operation simply takes the remainder portion of integer division.
Binary Modulo in Programming
Modulo is frequently used in programming for cyclic counters, indexing, divisibility tests, parity checks, wrapping values, hashing-related operations, and extracting ranges when the divisor has useful mathematical properties.
Although programming languages often display operands in decimal, hexadecimal, or another notation, the processor ultimately operates on binary data.
Binary Modulo and Even or Odd Numbers
Modulo 2 is a simple way to test whether a non-negative integer is even or odd. Binary makes this particularly easy because the least significant bit already contains the answer.
Equivalently, an unsigned binary integer ending in 0 is even, while one ending in 1 is odd.
Can Long Binary Values Be Used?
Yes. The main modulo calculation works directly with binary strings rather than first converting the complete inputs into ordinary JavaScript numbers.
The routine performs binary long division internally and keeps the remaining value after each step.
Binary Modulo Examples
| Dividend | Modulus | Binary Result |
|---|---|---|
1 |
1 |
0 |
101 |
10 |
1 |
1000 |
10 |
0 |
1010 |
11 |
1 |
1111 |
11 |
0 |
110110 |
101 |
100 |
11010110 |
1000 |
110 |
Common Binary Modulo Mistakes
Returning the quotient
Modulo returns the remainder, not the quotient.
Using modulus zero
Modulo zero is undefined because division by zero is undefined.
Using invalid binary digits
A valid binary operand can contain only 0 and 1.
Ignoring signed behavior
Modulo with negative operands may follow different conventions across programming languages.
Related BinaryCon Tools
Binary Modulo Calculator FAQs
What is binary modulo?
What is the difference between binary division and binary modulo?
What is 101 mod 10 in binary?
101₂ mod 10₂ = 1₂. Decimal 5 divided by 2 leaves remainder 1.
What is 1010 mod 11 in binary?
1₂ because decimal 10 divided by 3 leaves remainder 1.
What is 1111 mod 11 in binary?
0 because 15 is exactly divisible by 3.
What is 110110 mod 101 in binary?
100₂, equivalent to decimal remainder 4.