Bitwise Calculator

Calculate AND, OR, XOR, NOT and shifts on 8, 16, 32 or 64-bit values with decimal, hex and binary output.

Runs in your browser Free

Inputs accept decimal, 0x hex or 0b binary. Values are treated as unsigned integers of the chosen width.

What are bitwise operations for?

Bitwise operators work on the individual bits of integers. They're used for flags, permission masks, hardware registers, network protocols, encryption algorithms and game development.

Supported operations

  • AND (&), OR (|), XOR (^)
  • NOT (~)
  • Left shift (<<) and right shift (>>)

Flexible input and output

Enter values in decimal, hexadecimal with 0x or binary with 0b. Results are shown in decimal, hex and binary together. Choose an 8, 16, 32 or 64-bit width to simulate real hardware behaviour.

How to use Bitwise Calculator

  1. Enter the first and, if needed, the second value.
  2. Choose the operation and bit width.
  3. Review the result in decimal, hex and binary.
  4. Copy the format you need.

Why use this tool?

Quickly verify bit masks when working on embedded systems and low-level code.

FAQ

Why does NOT 0 give 4294967295?

NOT flips every bit at the chosen width. In an unsigned 32-bit value all 32 bits become 1, which is 4,294,967,295.

What is XOR used for?

Finding differing bits, toggling bits and simple encryption tricks.

What does shifting left by 1 do?

It multiplies the value by 2; bits that overflow the chosen width are discarded.

Related tools