Bitwise Calculator

This bitwise calculator performs the core boolean and shift operations programme

Updated
Loading toolโ€ฆ

This bitwise calculator performs the core boolean and shift operations programme

How to use Bitwise Calculator

  1. Enter operand A, and operand B if the operation needs two inputs, choosing a base for each.
  2. Pick the operation (AND, OR, XOR, NOT, shift, and so on) and the bit width that matches your data.
  3. Read the result in binary, hex, decimal, and octal, and check the bit-by-bit breakdown to see how it lines up.
Try next โ†’CSS Formatter & BeautifierThis free CSS formatter cleans up messy or minified stylesheets in one step

About Bitwise Calculator

This bitwise calculator performs the core boolean and shift operations programmers reach for: AND, OR, XOR, NOT, NAND, NOR, XNOR, and logical left and right shifts. Enter operand A (and, for two-input operations, operand B) in decimal, binary, hex, or octal โ€” prefixes like 0x, 0b, and 0o are accepted, and underscores or spaces are ignored as digit separators. The result is shown at once in binary, hexadecimal, unsigned decimal, signed (two's complement) decimal, and octal, along with a bit-by-bit breakdown that lines up A, B, and the result so you can see exactly how each output bit is produced.

Every value is treated as a fixed-width unsigned register (8, 16, 32, or 64 bits) using two's complement. Because of this, operations that flip bits โ€” NOT, NAND, NOR, and XNOR โ€” as well as the signed reading of the result depend on the bit width you pick, just like they do in a real CPU or programming language. Right shift is performed as a logical shift (zero-filled) within the chosen width, and shifting by the full width or more yields zero. Calculations use JavaScript BigInt internally, so 64-bit values stay exact with no floating-point rounding.

The tool runs entirely in your browser. Nothing you type is uploaded, logged, or sent anywhere โ€” the arithmetic happens locally on your device, so you can use it for private or work values without concern.

Frequently asked questions

How do I enter hex or binary values?
Set the base dropdown next to the operand to Hex, Binary, or Octal, then type the digits. You can include the 0x, 0b, or 0o prefix if you like, and spaces or underscores are ignored, so 0xFF, FF, and 1111_1111 all work.
Why does NOT (and NAND/NOR/XNOR) give a different answer at different bit widths?
Those operations flip bits, so the result depends on how many bits the register has. NOT of 0 is 0xFF in 8-bit but 0xFFFFFFFF in 32-bit. Pick the width that matches your data type (for example 32-bit for a typical int) to get the expected result.
How are negative numbers handled?
Negative operands are stored in two's complement within the chosen bit width. The result panel shows both an unsigned decimal reading and a signed two's-complement reading, so you can interpret it either way.
Is right shift arithmetic or logical?
Right shift here is logical: it fills the vacated high bits with zeros and works on the unsigned value within the selected width. Shifting by the full width or more produces zero.
How large a number can it handle?
Up to 64-bit values, computed exactly using BigInt so there is no floating-point rounding. Values are wrapped to the selected width, so anything outside the register range is masked to fit.
Is my data sent anywhere?
No. The calculator is 100% client-side. All parsing and bitwise math run in your browser, and nothing is uploaded or stored.