← All tools
// Number

Bitwise Calculator online

AND, OR, XOR, NAND, NOR, XNOR, NOT, shifts and bit rotation - browser-only

Bitwise Calculator logo
by
CHUNKY
MUNSTER

Using This Binary Logic Calculator

  1. Enter two integer values (in decimal, hex with 0x prefix, or binary with 0b).
  2. Select the operation: AND, OR, XOR, NOT, left shift, or right shift.
  3. The result appears in decimal, hex, and binary with the bit patterns shown side by side.
  4. Use the bit visualiser to see which bits are set in each operand and the result.

Bitwise Calculator provides a visual way to perform operations directly on the binary representation of integers. This bit manipulation tool is fundamental to systems programming and network masking, where each bit is tested or modified independently. This binary operation visualizer shows exactly how each logical gate changes individual bits in a 32-bit integer calculator context.

Bit Manipulation Operations Reference

AND (&) - a bit is 1 only if both inputs have 1. Used for bitwise and or xor masking. OR (|) - a bit is 1 if either input has 1. Used for setting flags. XOR (^) - a bit is 1 if the inputs differ. Used for toggling bits. NOT (~) - flips all bits. Bit shifter online - left shift (<<) and right shift (>>) move bit positions to multiply or divide by powers of 2. This binary logic calculator ensures complete accuracy for signed integers.

Frequently Asked Questions

How does bitwise AND work for masking?

0xFF in binary is 11111111. ANDing any value with 0xFF zeros out all bits above the low 8, extracting just the least significant byte. This is the basis of all bitmask operations.

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

>> is an arithmetic right shift - it preserves the sign bit, shifting in 1s for negative numbers. >>> is a logical (unsigned) right shift - it always shifts in 0s, treating the value as unsigned.

Why does ~ on a positive integer give a negative result?

JavaScript stores integers as 32-bit signed two's complement values. ~0 flips all 32 bits of 0 (all zeros) to all ones - which is -1 in two's complement signed representation.

How are file permissions like chmod 755 related to bitwise?

Unix permissions are three 3-bit fields: owner, group, other. 7 = 0b111 (rwx), 5 = 0b101 (r-x). Each bit represents a permission flag - read (bit 2), write (bit 1), execute (bit 0).

Whether you're developing high-performance code or troubleshooting network masks, our bit-level tools provide the precision you need. Explore our Binary to Decimal converter and Hex to Binary tool for comprehensive number-base work, and bookmark this Bitwise Calculator for all your logic operations.