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

Shareable link

Settings are written to the URL as you change them. Nothing differs from the defaults yet.

Bitwise OR calculator

Type a value into each operand field and the result updates as you type. Each field reads decimal, hexadecimal (0xFF), binary (0b10110010), and octal (0o377), and the two operands can use different bases. The result appears at once as unsigned decimal, hexadecimal, octal, and padded binary.

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.

Word size and signed output

Word size defaults to 32-bit and can be set to 8, 16, 64, or 128. Both operands are masked to that width before OR runs, so a value that does not fit wraps. Signed output reads the same bits as a signed integer. To apply a different operation to the same operands, 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