Our Bitwise Calculator helps you quickly perform AND, OR, XOR, NOT, Left Shift (<<), and Right Shift (>>) operations on decimal numbers. Understand how data bits are manipulated at the lowest level, crucial for programming, embedded systems, and digital logic. Convert decimals to 32-bit binary and see the bitwise results instantly.
Formula:
The calculator performs common bitwise operations on 32-bit signed integers in JavaScript:
- AND (
&): Sets each bit to 1 if both corresponding bits are 1. Example: 5 (0101) & 3 (0011) = 1 (0001) - OR (
|): Sets each bit to 1 if at least one of the corresponding bits is 1. Example: 5 (0101) | 3 (0011) = 7 (0111) - XOR (
^): Sets each bit to 1 if the corresponding bits are different. Example: 5 (0101) ^ 3 (0011) = 6 (0110) - NOT (
~): Inverts all bits. Example: ~5 (0...0101) = -6 (1...1010 in two's complement) - Left Shift (
<<): Shifts bits to the left, filling new bits with zeros. Example: 5 (0101) << 1 = 10 (1010) - Right Shift (
>>): Shifts bits to the right. The sign bit is propagated (signed right shift). Example: 5 (0101) >> 1 = 2 (0010)