Bitwise Calculator

Work out AND, OR, XOR, NOT and shifts on integers.

Bitwise Calculator

What it does

Works out bitwise operations such as AND, OR, XOR, NOT and bit shifts on whole numbers. Useful when working with flags, masks and low-level code. You see the result in decimal, binary and hex, with the bits lined up.

How to use the Bitwise Calculator

  1. Enter A and B in decimal, in hex with 0x or in binary with 0b.
  2. Pick the Operation; NOT uses only A, and shifts move A by B places.
  3. Choose the Width (8, 16, 32 or 64 bits) to match the type in your code.
  4. Press Calculate and read the result in binary, decimal and hex.

Related tools

More in Numbers

Bitwise Calculator questions

How do I use the Bitwise Calculator?

Enter the values in the fields of the tool and read the result below them.