ITInfoByte

Bitwise Calculator

Run any bitwise operation — AND, OR, XOR, NOT, left and right shifts — at a chosen register width, and read the result four ways: grouped binary, hex, unsigned decimal, and the two's-complement signed interpretation. Exactly how it behaves in C, Java or assembly.

Runs locally — nothing you enter is sent Calculators Free · no signup

How to use

  1. Choose the input base (decimal, binary or hex) and the bit width (8 to 64).
  2. Enter value A, pick the operation, and enter value B (or the shift amount).
  3. Press Calculate and compare the binary, hex, unsigned and signed views of the result.

Examples

12 AND 10
8 (1100 & 1010 = 1000)
NOT 0 in 8-bit
255 unsigned · −1 signed

Supported formats

  • Widths: 8, 16, 32, 64 bits — results wrap (mask) exactly like fixed-width registers.
  • Operations: AND, OR, XOR, NOT, logical left shift, logical right shift.

Privacy

This tool runs entirely in your browser. Nothing you enter or open is sent anywhere. Privacy policy.

Limitations

  • Right shift is logical (zero-fill), not arithmetic — sign-extending shifts differ in some languages.
  • Shift amounts are limited to the chosen width.

FAQ

What is two's complement?

The standard way computers store negative integers: a value with the top bit set represents value − 2^width. This calculator shows both the unsigned and signed reading of every result.

What does XOR actually do?

Each result bit is 1 when the two input bits differ. XOR is behind parity checks, simple ciphers, and the classic swap-without-a-temp trick.

Why does my result wrap around?

Because the calculator masks to the chosen width, just like a real register: 255 + a left shift in 8-bit wraps, exactly as a uint8_t would in C.