Bitwise calculator
Perform bitwise operations — AND, OR, XOR, NAND, NOR, XNOR, NOT, and shifts — on decimal, hex, or binary operands. Results show in decimal, binary, and hex at once.
Result
ANDBitwise operators act on each binary digit independently: AND keeps bits set in both operands, OR in either, XOR in exactly one. Shifts move bits left or right (operand B is the shift amount). NOT inverts every bit of operand A.
A free bitwise calculator that performs AND, OR, XOR, NAND, NOR, XNOR, NOT, left shift, and right shift on any integers you enter. Input operands in decimal, hexadecimal, or binary — results are shown in all three representations simultaneously. Everything runs locally in your browser.
How to use the bitwise calculator
- Select the operation from the dropdown (AND, OR, XOR, etc.).
- Enter the first operand in decimal, hex (prefix 0x), or binary (prefix 0b).
- For binary and two-operand operations, enter the second value.
- Results appear in decimal, binary, and hex at once.
Quick guide to bitwise operations
AND sets a bit to 1 only when both inputs have 1 in that position — used for masking. OR sets a bit when either input has 1 — used for combining flags. XOR sets a bit when inputs differ — used for toggling and simple swap algorithms. NOT flips every bit. Left shift multiplies by powers of two; right shift divides. NAND, NOR, and XNOR are the logical complements of AND, OR, and XOR respectively.
Frequently asked questions
What is a bitwise calculator used for?
Debugging bit flags, writing low-level code, working with network masks, implementing permissions systems, and learning computer architecture — any domain that manipulates individual bits.
Can I enter hex values into the bitwise calculator?
Yes. Prefix hex values with 0x (e.g. 0xFF) and binary values with 0b (e.g. 0b1010). Unprefixed values are treated as decimal.
What is XOR used for?
XOR is used in checksums, toggling specific bits, simple ciphers, RAID parity, and the classic in-place swap of two variables without a temporary buffer.
What is the difference between AND and NAND?
NAND is the bitwise complement of AND — every bit that AND would set to 1, NAND sets to 0, and vice versa.
Randomly