Bitwise Calculator

AND, OR, XOR, NOT, shifts and rotates at 8 to 64 bits.

Your input

Decimal, 0xFF, 0b1010, 0o17 or negative.
Result 0x00000030 32-bit
A
00000000 00000000 00000000 11110000
B
00000000 00000000 00000000 00111100
Result (binary)
00000000 00000000 00000000 00110000
Unsigned
48
Signed (two’s complement)
48

What are bitwise operations?

Bitwise operations work on the individual binary digits (bits) of whole numbers. AND keeps a bit only if both numbers have it set. OR keeps it if either does. XOR keeps it if exactly one does. NOT flips every bit. Shifts slide the bits left or right, and rotates move them around so none are lost.

Programmers use them for flags, masks, permissions, hashing and low-level protocols. The width matters: NOT 5 gives 250 in 8 bits but 4294967290 in 32 bits. This tool does the operation at 8, 16, 32 or 64 bits with exact results, and shows the binary and both unsigned and signed (two's complement) readings.

How to use the Bitwise Calculator

  1. Enter the first value and choose the operation.
  2. Enter the second value if the operation needs one.
  3. Choose the bit width.
  4. Read the result in hex, binary, unsigned and signed.

Real situations

When people use the Bitwise Calculator

  • 1

    Check a mask or flag in code

    See which bits survive when you AND a value with a mask such as 0x3C.

  • 2

    Understand a shift or rotate

    Watch the bits move to see why 1 shifted left by 4 is 16.

  • 3

    Verify embedded or network logic

    Check results against the hardware width you are working with, such as an 8-bit register.

  • 4

    Learn binary arithmetic

    Study how XOR, NAND, NOR and the other operations behave on real numbers, one bit at a time.

FAQ

Bitwise Calculator: questions answered

What is 0xF0 AND 0x3C?

0x30, which is 48. In binary 11110000 AND 00111100 gives 00110000. Only the bits set in both numbers remain. This is the default example in the tool at 32 bits.

What is 12 XOR 10 in 8 bits?

6. 00001100 XOR 00001010 is 00000110, because XOR keeps bits that differ.

Why does NOT depend on the width?

NOT flips every bit in the chosen width. NOT 5 is 11111010 in 8 bits, which is 250 unsigned or -6 signed. At 32 bits the same operation sets 32 bits, so the numbers differ.

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

Arithmetic shift right (>>) keeps the sign bit, so -8 shifted right by 1 in 8 bits is -4 (0xFC). Logical shift right (>>>) fills with zeros, so the same input gives 124 (0x7C).

What input formats are accepted?

Decimal, hex with 0x, binary with 0b, octal with 0o, and negative numbers. Values must fit in the chosen width.

What does rotate do?

A rotate moves bits off one end and back in at the other, so no bits are lost, unlike a shift. Rotates are common in hashing and encryption algorithms.

Is this Bitwise Calculator free and private?

Yes. It is free with no sign-in, and every calculation runs inside your browser. Nothing you type is sent to a server or stored, and the page keeps working offline once it has loaded.

Private by design. No accounts, no cookies, no tracking. Everything you type stays on your device.

How we keep it that way