Developer Tools
Bitwise Calculator
Compute bitwise AND, OR, XOR, NAND, NOR, XNOR, NOT, shifts, and rotations on two operands. Multi-base input, signed and unsigned, 8 to 128 bit widths.
Inputs
Type values in any base. Optional prefixes (0b, 0o, 0x) auto-detect.
Bit is 1 only when the matching bits of A and B are both 1.
Bit alignment
Most significant bit on the left.
Result
Binary
0000 0000 0000 0000 0000 0000 0000 1100
Hex
0x0000 000C
Octal
0o14
Decimal (unsigned)
12
Decimal (signed)
12
Set bits (popcount)
2 of 32
How to use
- Pick the input base (Binary, Octal, Decimal, or Hex). You can also paste values with 0b, 0o, or 0x prefixes and the calculator will auto-detect the base.
- Choose the bit width (8, 16, 32, 64, or 128). The bit grid and the signed and unsigned readouts always reflect the chosen width.
- Pick an operation. Logic operations (AND, OR, XOR, NAND, NOR, XNOR) read both operands; NOT reads only A; shifts and rotates read A and a positive shift amount.
- Type Operand A, then Operand B (when used) or the shift amount. Use Swap A and B to quickly flip operands, or Load example for a working starting point.
- Read the result in binary, hex, octal, signed decimal, unsigned decimal, and popcount. Click Copy on any row, or Copy summary for the full breakdown.
About this tool
Bitwise Calculator runs every common bit-level operation against one or two operands and shows the result aligned bit by bit so you can verify the work at a glance. Type each operand in any base (binary with an optional 0b prefix, octal with 0o, decimal, or hex with 0x) and the calculator auto-detects the base from the prefix when one is present, or honors the base buttons when there is none. Pick a bit width from 8, 16, 32, 64, or 128 bits and the bit grid, the unsigned and signed decimal readouts, and the wrap-around behavior all match what a fixed-width register would do. Operations cover the full set of bitwise primitives: AND (mask), OR (merge), XOR (toggle and difference), NAND, NOR, and XNOR (the inverted forms used in hardware logic), NOT on operand A (one's complement inside the chosen width), arithmetic shift right (preserves the sign bit, used for signed division by powers of two), logical shift right (zero-fills the high bits), shift left (zero-fills the low bits), and rotate left and rotate right (wrap bits around the width with no loss). The bit grid renders most-significant bit on the left, marks every byte boundary, and uses color to show set bits in green, the result row in blue, and unset bits in muted slate so a 32-bit XOR or a 64-bit AND is readable in one glance. The result panel reports the value in binary (grouped in nibbles), hex (grouped in 16-bit blocks), octal, unsigned decimal, signed two's-complement decimal, and a popcount of how many bits are set. Each row has its own copy button, plus a Copy summary action that bundles the operation, both operands, the chosen width, and every result format into a paste-ready block. Useful for embedded firmware, networking masks (complementing the subnet calculator), permission flags (alongside the chmod calculator), CRC and hash debugging, CTF and reverse engineering, computer architecture coursework, and anywhere you need to confirm what AND, OR, XOR, or a shift will actually produce. Everything runs on your device using BigInt math; the operands you type are not uploaded.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Number Base Converter
Binary, octal, decimal, hex, and custom-base conversion with two's complement.
Open tool
ConverterBinary Translator
Bidirectional text and binary translation with UTF-8 byte breakdown.
Open tool
DeveloperSubnet Calculator
IPv4 CIDR network, broadcast, host range, mask, and binary view.
Open tool
DeveloperChmod Calculator
Convert chmod values between octal, symbolic (rwxr-xr-x), and clickable owner, group, and other checkboxes.
Open tool
ConverterHEX to RGB Converter
Convert HEX, RGB, RGBA, and HSL with a live preview.
Open tool