7 Operators
AND, OR, XOR, NOT, NAND, NOR, and XNOR — every core bitwise operation in one tool.
Compute AND, OR, XOR, NOT, NAND, NOR & XNOR on two numbers with a live bit-level visualization. Enter values in decimal, hex, binary, or octal — get the result in all four instantly.
Every operator you need for flags, masks, and low-level logic — in one place.
AND, OR, XOR, NOT, NAND, NOR, and XNOR — every core bitwise operation in one tool.
Left shift and right shift with a configurable shift amount.
See every bit of A, B, and the result highlighted at 8, 16, or 32-bit width.
Enter and read values in decimal, hexadecimal, binary, or octal.
Pick AND, OR, XOR, NOT, NAND, NOR, XNOR, or a shift from the tabs.
Type Value A (and B, if needed) in decimal, hex, binary, or octal.
See the answer instantly in all four formats, plus a bit-level breakdown.
Bitwise operators work directly on the individual binary digits (bits) of a number, rather than treating the number as a whole. They're foundational in low-level programming, embedded systems, graphics, cryptography, and anywhere permission flags or compact data encoding are used — file permissions (chmod), RGBA color channels, network protocol headers, and feature flags all lean on bitwise logic.
| A | B | AND | OR | XOR | NAND | NOR | XNOR |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |
ANDing a value against a mask isolates specific bits — for example, value & 0xFF extracts just the lowest 8 bits of a number. This is the basis of reading individual flags out of a packed integer, such as checking if the "read" permission bit is set in a Unix file mode.
ORing a value with a bit pattern sets those bits without disturbing any others — flags | 0b0100 turns on the third bit regardless of what the rest of flags currently holds. Combining several individual flag constants with OR is the standard way many APIs let you pass multiple options in a single integer argument.
XOR has a unique property: applying the same XOR operation twice returns the original value ((A XOR B) XOR B = A). This makes XOR useful for toggling specific bits on and off, swapping two variables without a temporary variable, computing simple checksums, and implementing basic stream-cipher-style obfuscation.
A left shift (<<) multiplies a number by a power of two by moving every bit left and filling the vacated positions with zero. A right shift (>>) divides by a power of two the same way, moving bits right. Shifts are commonly faster than equivalent multiplication or division and are used heavily in performance-sensitive and embedded code.