Skip to main content
NeatUtility

Bitwise Calculator & Logic Inspector

Numbers & Units100% Client-Side
Ready
TEXT
0 lines0 chars
0 B / 9.8 KB
About this tool, examples & FAQ

Evaluate bitwise logical operations and shifts across configurable word widths with binary visualizers and two's complement inspection.

Key facts

Verified capabilities and limits of this utility
Supported operationsAND, OR, XOR, NOT, NAND, NOR, XNOR, Left Shift (<<), Arithmetic Right Shift (>>), Logical Right Shift (>>>)
Configurable word sizes8-bit (Byte), 16-bit (Word), 32-bit (Dword), 64-bit (Qword), Auto-detect
Binary formatting4-bit nibble grouping with aligned bit indices and two's complement representation
Max input size10 KB
Execution deadline1 s
Processing locationBrowser-only: bitwise math executes locally in a Web Worker

How to use

  1. Enter Operand A in decimal, hex (0x...), binary (0b...), or octal (0o...).
  2. Enter Operand B in the secondary slot, or enter an expression like '12 & 10' directly in Operand A.
  3. Select your target operation (e.g. All Operations, AND, OR, XOR, NOT, Shift).
  4. Choose word size (8, 16, 32, 64-bit) for masking and sign extension.
  5. Choose layout format (Detailed Table, Visual Breakdown, or JSON Model).
  6. Click 'Run' or press Ctrl+Enter to view the bitwise computation.

Example

Bitwise AND on 8-bit integers

Input

12
10

Example output

Bit Width: 8-bit | Mask: 0xFF

Operation    Expression   Binary (8-bit)        Hex   Signed Dec Unsigned Dec
-----------------------------------------------------------------------------
INPUT_A      Operand A    0000 1100       0x0C           12           12
INPUT_B      Operand B    0000 1010       0x0A           10           10
AND          A & B        0000 1000       0x08            8            8

Edge cases

Signed Arithmetic vs Logical Right Shift

Arithmetic shift (>>) preserves the two's complement sign bit, while logical shift (>>>) zero-fills high-order bits.

Bit width masking on NOT (~)

Inverting bits depends on word width: ~12 in an 8-bit word produces 243 (0xF3 / -13), while in a 32-bit word it produces 4,294,967,283 (0xFFFFFFF3).

Arbitrary-precision BigInt numbers

Uses native JavaScript BigInt internally to prevent IEEE 754 precision loss when operating on large 64-bit integers.

How it works

  1. Parses numeric inputs from decimal, binary, hex, or octal representations into BigInt.
  2. Calculates word size bitmasks (e.g. 0xFF for 8-bit, 0xFFFFFFFF for 32-bit).
  3. Computes bitwise logical operations and shifts using masked BigInt arithmetic.
  4. Derives signed two's complement and unsigned values.
  5. Formats binary strings with 4-bit nibble grouping for readability.

Frequently asked questions

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

Arithmetic Right Shift (>>) preserves the sign bit (the most significant bit in two's complement). When shifting a negative number, vacated bits are filled with 1s. Logical Right Shift (>>>) always fills vacated positions with 0s regardless of sign.

How does the bit width option affect NOT (~) operations?

Inverting bits with NOT flips all bits within the selected word size. In an 8-bit word, ~0b00001100 produces 0b11110011 (0xF3). In a 32-bit word, it produces 0xFFFFFFF3. Setting the proper width ensures outputs match target hardware registers.

Is calculation performed locally?

Yes. All bitwise calculations run locally in your browser using a dedicated Web Worker without transmitting data.

References