Binary Operations Calculator
Enter one or two binary integers and compare the padded binary result with its exact decimal value.
A QUICK WALKTHROUGH
How to use this tool
- Enter a binary value A and, for AND, OR, or XOR, a binary value B.
- Choose the bitwise operation.
- Calculate and read the fixed-width binary and decimal results.
Exact binary integers
Each operand must contain only 0 and 1 and may be 1–256 bits long. The calculator uses BigInt, so it does not round long inputs.
Defined width for NOT
AND, OR, and XOR use the longer operand width and add leading zeroes to the shorter result. NOT flips every bit within operand A or B’s written width, including leading zeroes.
Private local processing
Validation and calculation run in your browser. The values are not uploaded or stored by this page.
GOOD TO KNOW
Common questions
Can I enter a 0b prefix or spaces?
No. Enter only 0 and 1; prefixes, separators, signs, and decimal digits are rejected.
Why does NOT need a width?
An integer has infinitely many leading zeroes in theory. This tool uses the number of bits you entered so the complemented result is finite and predictable.
Are leading zeroes preserved?
Yes. The displayed result is padded to the operation width, and NOT uses the exact written operand width.