Binary Calculator
Binary arithmetic with decimal, hex and octal output.
AND, OR, XOR, NOT and shifts, with the bits shown.
| Operation | Decimal | Bits |
|---|
Bitwise Calculator applies AND, OR, XOR, NOT and the two shift operations to numbers at a fixed register width, and shows the bit pattern at every step. Seeing the bits lined up is the point: bitwise operations are column arithmetic, and once the columns are visible the result stops being mysterious.
Width is a genuine input, not a display choice. AND, OR and XOR give the same answer at any width, but NOT and the shifts do not: ~202 is 53 in eight bits and 4,294,967,093 in thirty-two, because NOT flips every bit in the register and a wider register has more bits to flip. A left shift past the top of the register loses those bits entirely. Choose the width your language or protocol actually uses and the answer will match it.
These operations are the basis of flags and masks. AND with a mask tests or clears bits, OR sets them, XOR toggles them, and a shift moves a value into position within a packed field. Permission bits, network masks, hardware registers and compression formats are all built from exactly these five operations, which is why the comparison rows show AND, OR and XOR together.
The page shows its working, not just its answer. Where there is a formula it is printed with your own numbers substituted in, so you can check the result rather than take it on trust -- which is the difference between a calculator you can use for something that matters and one you cannot.
Everything runs inside your browser. What you type is never uploaded, never logged and never stored, and the calculator keeps working if your connection drops after the page has loaded.
Looking for something this does not cover? FreeToolsHub.org is another hub of free online tools that need no account, and it is worth a look if bitwise calculator is only part of what you are working on.
The bitwise calculator is used by writers, developers, students, marketers and anyone else who needs the job done once without installing software. Common cases include:
Because it flips every bit in the register. Eight bits and thirty-two bits give very different numbers for the same input.
AND sets a result bit only when both inputs have it set, so it clears bits. OR sets it when either does, so it sets bits.
Toggling bits, simple checksums and detecting difference: a XOR b is zero only when the two are identical.
They are discarded. A left shift past the top of the register loses the high bits, which is why the width matters.
If the bitwise calculator is not quite what you need, these other free tools solve closely related problems, and there are 11 more in tech calculators.
Binary arithmetic with decimal, hex and octal output.
Hex arithmetic with decimal, binary and octal output.
IPv4 subnet details from an address and prefix.
Convert a number between binary, octal, decimal, hex and custom bases.
Bytes to KB, MB, GB and the KiB/MiB/GiB family.
Checked and rebuilt on 2026-10-14. The method this calculator uses is described in the section above, and corrections go through the contact page.