ToolBark
Developer

Bitwise Calculator

Instant AND, OR, XOR, NOT & shift results in dec, hex, and binary

Inputs

Parsed values

A =60B =13

Results

OperationDescriptionValue
A AND B12
A OR B61
A XOR B49
NOT A4294967235
NOT B4294967282
A << shift240
A >> shift15

All formats — A AND B

dec12
hex0x0000 000C
bin0b0000 0000 0000 0000 0000 0000 0000 1100
About

The Bitwise Calculator lets developers instantly evaluate AND, OR, XOR, NOT, left shift, and right shift operations on any two integers. Results are displayed side-by-side in decimal, hexadecimal, and binary across 8, 16, 32, or 64-bit widths — making it easy to debug low-level code, write bitmasks, or understand flag registers without leaving your browser.

FAQ
What number formats can I enter?+

You can enter plain decimal integers (e.g. 60), hexadecimal with a 0x prefix (e.g. 0x3C), or binary with a 0b prefix (e.g. 0b111100). Negative numbers are supported for decimal input.

How does NOT work here?+

NOT inverts all bits within the selected bit width. For example, NOT 60 in 8-bit is ~0b00111100 = 0b11000011 = 195. The result is always masked to the chosen width (8, 16, 32, or 64 bits).

Why does the result change when I switch bit widths?+

Bitwise operations are inherently width-dependent. A 32-bit NOT of 0 is 0xFFFFFFFF, while a 16-bit NOT of 0 is 0xFFFF. Choosing the correct width to match your target platform ensures accurate results.

Can I use this for bitmask flags?+

Yes. Enter your bitmask as one value (e.g. 0xFF00) and a flag as the other, then read the AND result to test the flag, OR to set it, and XOR to toggle it. Results are shown in all three bases for easy copy-paste into code.

Related tools