Bitwise Calculator

Inspect masks and shifts with an explicit bit width and signed/unsigned interpretations.

Numbers & Units
Preparing your workspace…

Input

Preparing your workspace…

Output
Your result will appear here.

How to use

  1. Choose the input base and the number of bits.
  2. Enter operands, choose an operation and set a shift count when needed.
  3. Inspect signed/unsigned values and copy decimal, hex or binary.

Bitwise operations with an explicit width

Bitwise calculations operate on corresponding bits rather than decimal digits. AND keeps bits present in both operands; OR combines them; XOR keeps bits that differ.

Choose a width from 8 to 256 bits before interpreting a result. The same bit pattern can have a positive unsigned value and a negative signed two’s-complement value.

Representations and workflow

Supported operations are AND, OR, XOR, NOT, NAND, NOR, XNOR, left shift, logical right shift and arithmetic right shift. The second operand is unused for NOT and shifts.

Worked example
Input
170 AND 15 (8-bit)
Result
10

10101010 AND 00001111 = 00001010. The unsigned and signed decimal results are both 10.

Precision and validation

Results are masked to the chosen width. Left shifts discard bits that leave the word; logical right shifts fill with zeros; arithmetic right shifts repeat the sign bit.

Interpreting and reusing the result

Negative input must fit the signed range and positive input may use the full unsigned range. Shift counts are 0 through width minus one; they are never silently reduced modulo 32.

Processing limits

Numbers: up to 500 lines / 1 MiB, at most 4,096 characters per numeral. Fraction output: 1–128 digits. Text and byte data: 64 KiB. Bitwise operations: 8–256 bits. Workers stop after 30 seconds; inputs are not uploaded.

?

Frequently asked questions

Why do signed and unsigned results differ?

Two’s complement gives the highest bit a negative weight when interpreted as signed. An all-ones 8-bit word is unsigned 255 or signed −1.

What is the difference between the two right shifts?

Logical right shift inserts zeros. Arithmetic right shift treats the word as signed and repeats its sign bit.

Are 64-bit values truncated to 32 bits?

No. BigInt arithmetic preserves the selected width, including 64, 128 and 256 bits. Only bits outside that explicit width are discarded.

Is my input sent to a server?

No. Computation runs in a browser worker. DevToolsy does not upload or store your input.

What does Copy include?

Copy exports the selected displayed value. Download JSON preserves strings and diagnostic codes; it does not turn large numbers into floating-point values.

Find your next tool

Language

Switch language? Your current work will be cleared. Copy or download it first.