Free Bitwise Calculator

Perform bitwise operations on integers and view results in decimal, hex, and binary.

Enter values and click Calculate.

How It Works

  1. Enter two numbers: Input the values you want to operate on — in decimal, binary (prefix 0b), or hexadecimal (prefix 0x).
  2. Select the operation: Choose AND, OR, XOR, NOT, left shift (<<), or right shift (>>).
  3. View the result: The output shows the result in decimal, binary, and hex simultaneously, with a bit-level visualization.

Why Use Bitwise Calculator?

Bitwise operations are fundamental in systems programming, cryptography, game development, graphics, networking, and embedded systems. Understanding how AND, OR, XOR, and shift operations manipulate individual bits is critical for tasks like setting/clearing flags, packing data into compact formats, and implementing efficient algorithms. This calculator shows the operation at the bit level so you can see exactly how each bit is affected.

Features

Frequently Asked Questions

What is XOR used for in programming?

XOR (^) is used for toggling bits, simple encryption/obfuscation, swap operations without a temp variable, parity checks, and hash mixing. It returns 1 when bits differ and 0 when they are the same.

What is the difference between << and >>?

Left shift (<<) moves all bits to the left, equivalent to multiplying by powers of 2. Right shift (>>) moves bits right, equivalent to dividing by powers of 2. Arithmetic right shift preserves the sign bit; logical right shift fills with zeros.

How do I set or clear a specific bit?

To set bit n: value |= (1 << n). To clear bit n: value &= ~(1 << n). To toggle bit n: value ^= (1 << n). To check if bit n is set: (value & (1 << n)) !== 0.

Related Tools

Binary Text Number Base Chmod Calculator Hash Generator