Apply bitwise AND, OR, XOR, and NOT to decimal numbers with instant binary visualization
Enter two decimal numbers, choose an operation, and see the result in decimal, binary, and hex.
I have been building developer tools for years, and the one thing I keep coming back to is how often bitwise operations come up in real code. Whether you are debugging a permission system, setting flags in a game engine, or writing low-level embedded firmware, being able to quickly compute a & b, a | b, a ^ b, or ~a on plain decimal numbers is a superpower. I built this decimal bitwise calculator because I got tired of mentally converting to binary, running the operation, and converting back — every time I reached for my system calculator it did not speak bits. This tool lets you enter decimal numbers directly, pick an operation, and see the result in decimal alongside its full 32-bit binary representation. I find it especially useful when I am explaining bitmask patterns to junior developers — showing them 42 & 15 = 10 with the binary side by side makes the concept click in seconds instead of minutes.
The binary grouping (8-8-8-8) makes it easy to see which byte each bit belongs to, which matters a lot when you are working with packed data structures or network protocols. I also included the detail grid at the bottom showing the result in binary, decimal, and hex simultaneously — that is the view I use most when I am double-checking register values during firmware debugging. The NOT operation deserves special attention: when you click NOT, the calculator hides the second input and shows a hint explaining that it is a unary operation. This is deliberate — I have watched too many developers enter two numbers and wonder why the result looks wrong. Bitwise NOT flips all 32 bits, and in signed 32-bit arithmetic that means ~5 = -6 (not 4294967290), which is the convention this calculator follows by treating the result as a signed 32-bit integer. If you need an unsigned interpretation, the hex and raw binary displays give you what you need.
Enter up to two decimal numbers in the Number A and Number B fields. Click one of the operation buttons — AND, OR, XOR, or NOT. The result appears below showing the decimal value and its 32-bit binary representation grouped into four 8-bit segments. NOT is a unary operation that only uses Number A; the second input is hidden when NOT is selected.
Bitwise AND (&) compares each bit position independently — a bit in the result is 1 only if both corresponding bits are 1. Logical AND (&&) evaluates truthiness and returns a boolean. For example, 5 & 3 = 1 (bitwise, because binary 101 & 011 = 001), while 5 && 3 = true (logical, because both values are truthy). This calculator performs bitwise operations exclusively.
Bitwise NOT (~) flips all 32 bits of the number. In signed 32-bit integer representation, the most significant bit (bit 31) is the sign bit. Flipping all bits of a positive number produces its two's complement negative equivalent. For example, ~5 = -6. The raw binary display shows the full unsigned 32-bit pattern regardless of how the signed value is interpreted.
Absolutely. Enter your value in Number A and your mask in Number B. Use AND to test whether specific bits are set, OR to set bits, and XOR to toggle bits. The binary display shows exactly which bit positions are affected. The example buttons provide ready-made scenarios — try 42 & 15 to extract the lower nibble, or 255 ^ 128 to toggle the high bit of a byte. This is the same workflow I use when setting up hardware register masks in embedded C code.
Decode hex strings to readable text instantly
Multi-base number converter — bin, oct, dec, hex
64-bit base conversion with BigInt precision
Compute SHA-256 checksums in your browser