Skip to content

Binary & Bitwise Calculator

AND, OR, XOR and NOT, with the overflow width.

Work out Binary & Bitwise. AND, OR, XOR and NOT, with the overflow width. Free, with no account and nothing to install.

Written and maintained by Mohit PatelLast checked August 4, 2026How we build these

Result

8

1000 binary · 0x8 hex

Decimal8
Binary1000
Hexadecimal0x8
Octal0o10
First operand in binary1100
Second operand in binary1010
Bits required4
Overflows 8 bitsNo
Overflows 16 bitsNo

Bitwise operations work on each bit position independently. AND keeps a bit only where both operands have it, OR where either does, and XOR where exactly one does — which is what makes XOR its own inverse and useful for toggling and for simple ciphers. AND is how masks work: ANDing with 0x0F keeps the low four bits and clears the rest, which is the standard way to extract a field from a packed value. OR sets bits without disturbing the others. NOT flips every bit, and in two's complement that turns n into −(n+1). That is why NOT 255 is −256 rather than 0 — the result is interpreted as signed, and the leading bits are all set.

How the Binary & Bitwise Calculator works

Bitwise and arithmetic operations with the result in binary, hex and octal, and the register width at which it would overflow. Includes the two's-complement behaviour that makes NOT 255 equal −256.

Also known as: bitwise and or xor calculator · binary addition calculator · what is a bitmask · twos complement calculator

Frequently asked questions

What do AND, OR and XOR do?

AND keeps a bit only where both operands have it, OR where either does, XOR where exactly one does. XOR being its own inverse is what makes it useful for toggling and for simple ciphers.

What is a bitmask?

A value ANDed with another to extract specific bits. ANDing with 0x0F keeps the low four bits and clears the rest — the standard way to pull a field out of a packed value.

Why is NOT 255 equal to −256?

Two's complement. NOT flips every bit, and in a signed interpretation that turns n into −(n+1). The result is not 0 because the leading bits are all set.

What is overflow?

A result too large for the register holding it. 200 + 100 fits comfortably in a 16-bit register and wraps to 44 in an 8-bit one, which is why the width is flagged here.

Why does XOR appear in cryptography?

Because it is reversible: XORing twice with the same key returns the original. That property makes it the core of stream ciphers, though XOR alone with a reused key is trivially broken.

Put this calculator on your own site

Free to use, on any site, commercial or not. Paste this where you want it to appear. It is a plain iframe, so it works in WordPress, Squarespace, Wix, Webflow, Ghost and anything else that accepts HTML.

The one-line version
<iframe src="https://www.thecalclibrary.com/embed/binary-arithmetic-calculator" width="100%" height="640" style="border:1px solid #e2e8f0;border-radius:12px" loading="lazy" title="Binary & Bitwise Calculator"></iframe>
<p style="font:13px/1.5 system-ui,sans-serif;margin:6px 0 0;color:#64748b">Powered by <a href="https://www.thecalclibrary.com/binary-arithmetic-calculator" style="color:#64748b">Binary & Bitwise Calculator</a> from The Calc Library</p>

The only condition is that the credit line below the frame stays in place. That one line is what pays for the tool being free — it is how anyone else finds it.

Related calculators