PasteZap
🌐 English
Free · No account

FREE · DEVELOPER TOOLS

Bitwise Calculator.

Calculate AND, OR, XOR, NOT and shifts on 8, 16, 32 or 64-bit integers, signed or unsigned, with results in decimal, hex and binary.

Limits & supported formats

Integers only, up to 64 bits. Everything is calculated in your browser; nothing you type is uploaded.

Loading the calculator…

Steps to use Bitwise Calculator

Enter A and B in decimal, 0x hex, 0b binary or 0o octal, choose the width and signedness, and the shift amount.

How Bitwise Calculator processes your input

Values are truncated to the chosen width like a fixed-size register. Arithmetic right shift keeps the sign bit; logical right shift fills with zeros. Exact BigInt arithmetic, so 64-bit values keep every bit.

Bitwise Calculator: worked example

0b11001010 AND 0x3C = 0x08 (8); NOT 0 is −1 as a signed 8-bit value and 255 unsigned.

Calculate bitwise operations

  1. Enter A and B in decimal, hex (0x), binary (0b) or octal (0o).
  2. Choose the width (8, 16, 32 or 64 bits) and whether the values are signed or unsigned. Set the shift amount if you need shifts.
  3. Read AND, OR, XOR, NOT and the shifts, each in decimal, hex and binary.

Example: 0b11001010 AND 0x3C = 0x08 (8). NOT 0 is −1 as a signed 8-bit value, and 255 as unsigned: the same bits, read two ways.

How values behave

  • Values are truncated to the chosen width, like a fixed-size CPU register, so overflow wraps around.
  • An arithmetic right shift keeps the sign bit; a logical right shift fills with zeros. The difference only shows on negative signed values.
  • Arithmetic uses exact big integers, so 64-bit values keep every bit, unlike plain JavaScript numbers.
  • Integers only, up to 64 bits. Everything runs in your browser. To convert numbers between bases, use the number base converter; to inspect floats, the IEEE 754 converter.

Questions about Bitwise Calculator

Why does NOT 0 give −1?

NOT flips every bit, so 0 becomes all ones. In two’s complement signed form that pattern means −1; read as unsigned 8-bit it is 255.

What is the difference between >> and >>>?

An arithmetic shift (>>) copies the sign bit into the new bits; a logical shift (>>>) fills them with zeros.

Does it handle 64-bit values exactly?

Yes. The calculator uses big integers, so no bit is lost above 2^53.

Is Bitwise Calculator free, and do I need an account?

Yes. This tool is free to use in your browser without an account. Processing takes place on your device.

What are the limits and what should I check?

Integers only, up to 64 bits. Everything is calculated in your browser; nothing you type is uploaded. Review the result before using it in your work.

Is my input sent to a server?

Your input is processed in your browser and is not uploaded by this tool. Files and pasted text are cleared when the page is refreshed. Normal website requests are still required to load the page and its libraries. Read the privacy explanation.