Skip to content

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

  1. Enter values in decimal (including negatives), hex with 0x, binary with 0b or octal with 0o.
  2. 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.

Browse all bitwise tools →