Bitwise operations are the native language of processors. They pack flags into one integer, mask out bytes, compute hashes and checksums, and power graphics, compression and cryptography.
How to use the Bitwise Calculator
- Representation
- Number format
- Number 1
- Number 2
- Operation
Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.
How it works
Choose the representation (bit width), the number format and the operation, then enter both numbers. The bit-by-bit layout shows exactly which bits produced the result.
Formula
AND: 1 if both bits are 1 · OR: 1 if either is 1 · XOR: 1 if they differ
NOR = NOT OR · NAND = NOT AND · XNOR = NOT XOR
Worked example
Inputs — Representation: 8-bit; Number format: Binary; Number 1: 1011; Number 2: 0110; Operation: AND.
Results — Result (binary) = 0000 0010; Result (decimal, unsigned) = 2; Result (decimal, signed two's complement) = 2; Result (octal) = 2; Result (hexadecimal) = 2; Bit by bit = 0000 1011
AND 0000 0110
─────────
= 0000 0010.
Key terms
- Two's complement
- The usual way computers store negative integers.
Frequently asked questions
What does 1011 AND 0110 give?
0010.
Which operations are universal?
NAND and NOR – every logic circuit can be built from either one.
What is XNOR used for?
Equality testing: it outputs 1 when both bits are the same.
Why are results different for different widths?
Inverting operations (NOR, NAND, XNOR) turn leading zeros into ones.