Calculators

Bitwise Calculator

Calculate fixed-width binary AND, OR, XOR and NOT with exact binary and unsigned decimal results in your browser.

Calculate AND, OR, XOR or fixed-width NOT on 1 to 4096 binary digits. Leading zeros are preserved. For two inputs, widths must match. Processing stays in your browser.

Enter equal-width binary inputs and choose an operation.

How fixed-width bitwise operations work

AND returns 1 only when both bits are 1. OR returns 1 when either bit is 1. XOR returns 1 when the bits differ. NOT flips each bit of A within its entered width. For A = 1011 and B = 1100, AND gives 1000 (8), OR gives 1111 (15), and XOR gives 0111 (7). NOT of 1011 gives 0100 (4). Inputs must contain 1 to 4096 binary digits with equal widths for two-input operations. Leading zeros define the width and are preserved. Surrounding whitespace is accepted; prefixes, internal spaces, signs and other digits are rejected. Results are unsigned: NOT does not produce a negative two’s complement integer or extend the word beyond the entered width. B is ignored for NOT. There is no implicit padding or 32-bit truncation. Calculations run locally in your browser.

Frequently Asked Questions

Everything you need to know about this tool, how it works, and privacy.

What does XOR do?

XOR outputs 1 where the corresponding input bits differ. For 1011 and 1100, XOR gives 0111.

Why must input widths match?

The calculator compares each position directly. Add leading zeros yourself when a wider word is needed.

How does NOT handle word width?

NOT flips only the entered bits. NOT of 0011 is 1100, while NOT of 11 is 00. Results are unsigned.

Are large inputs truncated to 32 bits?

No. Up to 4096 bits are processed exactly, and the decimal result uses BigInt.

Is a separate guide needed?

The inline instructions explain the operations, examples, width rules and unsigned interpretation. No extra setup is required.