Skip to main content
Developer tools100% FreeInstant

Bitwise Calculator: AND, OR, XOR, NOT and Shifts

This free bitwise calculator applies AND, OR, XOR, NOT, NAND, NOR and bit shifts to two numbers. Enter decimal, hex (0x) or binary (0b) and see the result in all three bases, with the bits shown.

By Debmedia Technologies LLP · Kolkata, India · Updated

What Is It and When Do You Need It?

Bitwise operations work on the individual bits of numbers. They are used for flags, masks, permissions, graphics and low-level protocols. Doing them by hand means converting to binary, which is slow and error-prone.

Enter two numbers and choose an operation to see the bits.

How to Use This Tool

  1. Enter numbers in decimal, hex (0x) or binary (0b).
  2. Choose the operation and the bit width.
  3. Press Calculate.
  4. Read the binary, hex, decimal and signed results.

How the Calculation Works

Both inputs are read as big integers and masked to the chosen width, using two’s complement for negatives. The operation is applied to the whole word. NOT flips every bit within the width. Shifts move the bits and drop those that fall outside the width. The signed value treats the top bit as negative.

Worked Example

202 AND 15 in 8 bits: 11001010 AND 00001111 = 00001010, which is 10 (0x0A). 202 XOR 255 is 53.

Common Uses

  • Flags and permission masks.
  • Networking and subnet masks.
  • Embedded and low-level code.
  • Learning binary maths.

Tips and Common Mistakes

  • Use hex for masks, it lines up with the bits.
  • Shifting left by 1 doubles a number.
  • Check the width: 8-bit and 32-bit results differ for NOT.

Next, you may need the IEEE 754 converter, checksum calculator, ASCII table, semver comparator.

Everything runs in your browser. Nothing you type is uploaded, stored or sent to any outside service.

Frequently Asked Questions

It gives a 1 in each position where both numbers have a 1, and 0 elsewhere. It is used to mask bits.
It gives 1 where the bits differ. XOR is used for toggling bits and in simple checksums and ciphers.
They are shown in two’s complement for the chosen width, so −1 in 8 bits is 11111111.
The same bits read as a signed number, where the top bit is the sign.

Disclaimer: results are calculated in your browser from the numbers you enter. Check important results before you rely on them for money, health, safety or legal decisions.