Bitwise Calculator
Calculate AND, OR, XOR, NOT, NAND, NOR, XNOR and bit shifts at 8, 16, 32 or 64 bits with decimal, hex and binary results.
Runs in your browserIntegers → Decimal / hex / binary
Loading tool…
How to use the Bitwise Calculator
- Enter values in decimal (including negatives), hex with 0x, binary with 0b or octal with 0o.
- Choose the bit width so negative numbers and NOT are shown in two’s complement at that size.
Privacy and limitations
- Your data is processed on your device and is not uploaded to any server.
Frequently asked questions
Why does NOT 5 give -6?
NOT flips every bit. In two’s complement, flipping all bits of n gives -(n + 1), so ~5 is -6 signed, or 250 unsigned at 8 bits.
What is the difference between >> and >>>?
>> is an arithmetic shift that copies the sign bit into the vacated positions; >>> is a logical shift that always fills with zeros.
Related converters
Bitwise AND CalculatorCompute A AND B bit by bit to apply masks and test flags, shown in decimal, hex and padded binary.Bit Shift CalculatorShift a value left (<<), arithmetic right (>>) or logical right (>>>) within 8, 16, 32 or 64 bits.Two’s Complement ConverterConvert signed integers to and from two’s complement binary and hex at 8, 16, 32 or 64 bits.Bitwise OR CalculatorCompute A OR B bit by bit to combine flags, with results in signed and unsigned decimal, hex and binary.Bitwise XOR CalculatorCompute A XOR B (exclusive or) to toggle bits or compare values, shown in decimal, hex and binary.Bitwise NOT CalculatorInvert every bit of a value (one’s complement) at a chosen width and see the signed and unsigned result.