Skip to main content

Bitwise Calculator: AND, OR, XOR, NOT and Bit Shifts

AND, OR, XOR, NOT and bit shifts on integers, with decimal, hex and binary side by side, all in your browser

  • Runs locally
  • Category Developer & DevOps
  • Best for Formatting, validating, shrinking, or inspecting code-adjacent text.
Bit width (for NOT / >>>)

Result

Decimal8
Hex0x8
Binary0b1000
Bit-by-bit (32-bit)
A00000000000000000000000000001100
B00000000000000000000000000001010
Result00000000000000000000000000001000

All math runs on BigInt — exact for integers of any size. Nothing leaves your browser.

What this tool does

A bitwise calculator for developers who work close to the metal: flags, masks, packed fields, hardware registers and network math. Type two operands and pick an operation. AND, OR and XOR combine A and B. NOT, left shift, right shift and unsigned right shift work on a single value. Every input accepts decimal, hexadecimal with a 0x prefix, or binary with a 0b prefix, and a leading minus sign is fine. Each result shows up at once in decimal, hex and binary, and a bit-by-bit panel lines A, B and the result up column for column so you can see exactly which bits flipped. The whole engine runs on BigInt, so a 64-bit register value or a number far past the 53-bit JavaScript safe range stays exact down to the last bit. NOT and unsigned right shift respect a chosen bit width of 8, 16, 32 or 64, matching how a fixed-width register actually behaves. Operands, operation and width all ride in the URL, so a shared link reopens the exact same calculation. Everything is client side, with one-click copy and no upload.

Tool details

Input
Form fields
The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
Output
Live result + Copy
The result area focuses on usable output, with copy, download, or preview actions when supported.
Privacy
Browser-side processing
The main tool logic does not call an external API, so inputs normally stay in the current tab.
Save / share
Shareable URL state
Key settings are encoded in the URL so another person can reopen the same setup.
Performance budget
Initial JS <= 9 KB
No WASM budget is declared, keeping the tool quick to open on mobile.
Best fit
Developer & DevOps · Developer
Category and role tags drive related tools, internal links, and quick fit checks.

How to use

  1. 1. Input

    Paste or drop your content into the tool panel.

  2. 2. Process

    Click the button. All processing is local in your browser.

  3. 3. Copy / Download

    Copy the result or download to disk in one click.

How Bitwise Calculator fits into your work

Use it in the small gaps between coding, reviewing, debugging, and shipping.

Developer jobs

  • Formatting, validating, shrinking, or inspecting code-adjacent text.
  • Preparing snippets for documentation, tickets, commits, or handoff.
  • Checking a small payload quickly without switching tools.

Developer checks

  • Run irreversible transforms like minify or obfuscate on a copy.
  • Keep secrets out of pasted snippets unless the tool explicitly stays local.
  • Use your normal tests or linter before shipping transformed code.

Good next steps

These links move the current task into a more complete workflow.

  1. 1 CRC32 Checksum Calculator Standard CRC-32 (IEEE) of any text in hex and unsigned decimal, with optional CRC32C, computed in your browser Open
  2. 2 Number Base Converter Number base converter — binary, octal, decimal, hex, and any base 2-36. Bitwise too. Open
  3. 3 Scientific Calculator Scientific calculator — sin / cos / log / sqrt / power, with full keyboard input + history, deg/rad mode. Open

Real-world use cases

  • Read and set hardware register flags

    A datasheet says bit 3 of a control register enables an interrupt and bits 4 to 6 hold a clock divisor. Drop the current register value in as 0x hex, AND with a mask to read a field, OR to set a bit, and XOR to toggle one. The bit-by-bit panel shows the whole register at the right width so you can confirm you touched only the bits you meant to.

  • Build and verify subnet masks by hand

    Network math is bitwise underneath. Take an address as decimal or hex, AND it with a mask like 0xFFFFFF00 to find the network portion, and read the binary view to count how many leading ones the mask has. It pairs naturally with an address-to-decimal step when you are checking whether two hosts share a subnet.

  • Pack several small fields into one integer

    Storing a color as one number, or flags in a single byte, means shifting each field into place and OR-ing them together. Left shift a value by the field offset, OR it with what you have so far, and later AND plus right shift to pull a field back out. The tool lets you try the packing and unpacking before you commit it to code.

  • Teach or learn two's complement and shifts

    Seeing 5, 0x5 and 0b101 update together, then watching NOT 0 become 255 in 8-bit but 65535 in 16-bit, makes two's complement click far faster than a lecture. Set a width, flip bits, and the padded binary rows show exactly what the machine stores, which is ideal for a class exercise or self-study.

Common pitfalls

  • Forgetting to set a bit width before NOT or unsigned right shift. Without a window, flipping every bit of a positive number gives a negative result. Pick 8, 16, 32 or 64 first so NOT 0 reads as 255 rather than -1, and so unsigned shift zero-fills correctly.

  • Confusing arithmetic right shift with unsigned right shift on negative values. Plain right shift keeps the sign bit, so a negative number stays negative. Unsigned right shift treats the value as an unsigned pattern in the chosen width and fills with zeros, which is the >>> behaviour many languages expose.

  • Typing a binary or hex value without its prefix. 1010 with no prefix is one thousand and ten in decimal, not the binary number ten. Always lead binary with 0b and hex with 0x so the tool reads the digits in the base you intend.

Privacy

Every operation, the parsing, the AND or XOR, the shifts, the two's complement and the binary rendering, is plain JavaScript running in your browser tab. No operand, mask or result is ever sent anywhere, and nothing is logged. The one thing to know: the shareable link encodes your two operands, the operation and the width in the URL query string, so a link pasted into chat will record those values in the recipient server's access log. If a value is sensitive, use the copy button and paste the result instead of sharing the link.

FAQ

Tool combos

Folks in your role tend to reach for these alongside this tool.

Made by Toolora · 100% client-side · Updated 2026-05-29