Zero Signup ToolsFree browser tools

Developer Tools

Bitwise Calculator

Compute bitwise AND, OR, XOR, NAND, NOR, XNOR, NOT, shifts, and rotations on two operands. Multi-base input, signed and unsigned, 8 to 128 bit widths.

Inputs

Type values in any base. Optional prefixes (0b, 0o, 0x) auto-detect.

Bit is 1 only when the matching bits of A and B are both 1.

Bit alignment

Most significant bit on the left.

31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
A
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
B
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
1
=
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0

Result

Binary

0000 0000 0000 0000 0000 0000 0000 1100

Hex

0x0000 000C

Octal

0o14

Decimal (unsigned)

12

Decimal (signed)

12

Set bits (popcount)

2 of 32

How to use

  1. Pick the input base (Binary, Octal, Decimal, or Hex). You can also paste values with 0b, 0o, or 0x prefixes and the calculator will auto-detect the base.
  2. Choose the bit width (8, 16, 32, 64, or 128). The bit grid and the signed and unsigned readouts always reflect the chosen width.
  3. Pick an operation. Logic operations (AND, OR, XOR, NAND, NOR, XNOR) read both operands; NOT reads only A; shifts and rotates read A and a positive shift amount.
  4. Type Operand A, then Operand B (when used) or the shift amount. Use Swap A and B to quickly flip operands, or Load example for a working starting point.
  5. Read the result in binary, hex, octal, signed decimal, unsigned decimal, and popcount. Click Copy on any row, or Copy summary for the full breakdown.

About this tool

Bitwise Calculator runs every common bit-level operation against one or two operands and shows the result aligned bit by bit so you can verify the work at a glance. Type each operand in any base (binary with an optional 0b prefix, octal with 0o, decimal, or hex with 0x) and the calculator auto-detects the base from the prefix when one is present, or honors the base buttons when there is none. Pick a bit width from 8, 16, 32, 64, or 128 bits and the bit grid, the unsigned and signed decimal readouts, and the wrap-around behavior all match what a fixed-width register would do. Operations cover the full set of bitwise primitives: AND (mask), OR (merge), XOR (toggle and difference), NAND, NOR, and XNOR (the inverted forms used in hardware logic), NOT on operand A (one's complement inside the chosen width), arithmetic shift right (preserves the sign bit, used for signed division by powers of two), logical shift right (zero-fills the high bits), shift left (zero-fills the low bits), and rotate left and rotate right (wrap bits around the width with no loss). The bit grid renders most-significant bit on the left, marks every byte boundary, and uses color to show set bits in green, the result row in blue, and unset bits in muted slate so a 32-bit XOR or a 64-bit AND is readable in one glance. The result panel reports the value in binary (grouped in nibbles), hex (grouped in 16-bit blocks), octal, unsigned decimal, signed two's-complement decimal, and a popcount of how many bits are set. Each row has its own copy button, plus a Copy summary action that bundles the operation, both operands, the chosen width, and every result format into a paste-ready block. Useful for embedded firmware, networking masks (complementing the subnet calculator), permission flags (alongside the chmod calculator), CRC and hash debugging, CTF and reverse engineering, computer architecture coursework, and anywhere you need to confirm what AND, OR, XOR, or a shift will actually produce. Everything runs on your device using BigInt math; the operands you type are not uploaded.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools