Binary Bitwise OR Calculator
Calculate bitwise OR of two binary numbers instantly. Visualize bit-by-bit OR logic with decimal, hex, and octal conversions.
About
The bitwise OR operation compares each bit position of two binary operands: if either bit is 1, the result bit is 1. Only when both bits are 0 does the output yield 0. This operation is foundational in register-level programming, permission flag systems, and subnet mask calculations. Misapplying OR where XOR or AND is required leads to silent data corruption - flags get set that should remain clear, and bitmask filters pass values they should reject. This calculator accepts operands up to 64 bits, computes the OR using native integer arithmetic, and displays the bit-by-bit truth table so you can audit every position.
The tool outputs results simultaneously in binary, decimal, hexadecimal, and octal. It assumes unsigned integer representation. For signed interpretation, the most-significant bit would require two's complement conversion, which this tool does not perform. Pro tip: when combining Unix file permission masks (e.g., 0644 | 0111 = 0755), always verify the result against your security policy before applying chmod.
Formulas
The bitwise OR operation is defined per bit position i across two unsigned binary integers A and B:
Where Ri is the result bit at position i, and โจ is the logical disjunction. The full integer result is reconstructed as:
Where n = total number of bit positions (determined by the longer operand). Equivalently, for full integers: R = A | B. Key algebraic properties of bitwise OR:
Where A = first binary operand, B = second binary operand, R = result, i = bit index (LSB = 0), n = bit width.
Reference Data
| A | B | A | B | Description |
|---|---|---|---|
| 0 | 0 | 0 | Both bits clear โ result clear |
| 0 | 1 | 1 | One bit set โ result set |
| 1 | 0 | 1 | One bit set โ result set |
| 1 | 1 | 1 | Both bits set โ result set |
| Bit Width | Max Unsigned Value | Common Use | All-Ones Mask |
|---|---|---|---|
| 4-bit | 15 | Nibble, hex digit | 1111 |
| 8-bit | 255 | Byte, ASCII, color channel | 11111111 |
| 12-bit | 4095 | ADC resolution, Unix permissions (octal) | 111111111111 |
| 16-bit | 65535 | Short integer, Unicode BMP | 1111111111111111 |
| 24-bit | 16777215 | RGB color (#FFFFFF) | 111111111111111111111111 |
| 32-bit | 4294967295 | IPv4 address, int32 | 11111111111111111111111111111111 |
| 48-bit | 281474976710655 | MAC address | 48 ones |
| 64-bit | 18446744073709551615 | Long integer, memory address | 64 ones |
| Operation | Symbol | Truth when | Identity element | Common mnemonic |
|---|---|---|---|---|
| AND | & | Both 1 | 1 (all ones) | Masking / clearing bits |
| OR | | | Either 1 | 0 | Setting / combining flags |
| XOR | โ | Bits differ | 0 | Toggling / checksums |
| NOT | ยฌ | Invert | N/A | Complement / inversion |
| Left Shift | << | Multiply by 2n | 0 | Fast power-of-two multiply |
| Right Shift | >> | Divide by 2n | 0 | Fast power-of-two divide |