TXT · Text & Data tools

Bitwise OR Calculator

Operand A
Operand B
expression

0x000000F0 OR 0x0000000F = 0x000000FF

32-bit result

0000 0000 0000 0000 0000 0000 1111 1111

Unsigned decimal
255
Hexadecimal
0x000000FF
Octal
0o00000000377
Go to the full Bitwise Calculator

Bitwise OR calculator

Apply OR to two integers and read the result as unsigned decimal, hexadecimal, octal, and 32-bit padded binary. Both operands are masked to 32 bits before the operation runs.

Setting flags

Bitwise OR is the standard way to combine binary flags. If you have a state variable, applying OR with a specific flag value forces that bit to 1 without altering the state of any other bits. A second OR with a different flag adds it to the same word without clearing the first.

Fixed 32-bit word

This page runs OR on a 32-bit unsigned word. Input accepts decimal, hexadecimal (0xFF), binary (0b10110010), and octal (0o377) automatically. For a different word size or signed output, use the full Bitwise Calculator.

Frequently Asked Questions

Bitwise OR compares two integers bit by bit. It returns 1 if at least one of the corresponding bits is 1. It is typically used to set specific bits in a register or flag variable.

To set the nth bit to 1, use an OR mask where only the nth bit is 1. For example, `number | (1 << 3)` forces the 4th bit to 1 while leaving all other bits untouched.

The result is the exact same number. Because bits are compared to themselves, `1 | 1` remains 1 and `0 | 0` remains 0.

Specific bitwise operations

Full Bitwise Calculator tool

Explore Our Tools

Browse all tools