How to use the Bitwise Calculator
- Enter A and B in decimal, 0x hex, 0b binary or 0o octal.
- Choose the bit width and signed or unsigned.
- Read every operation's result in decimal, hex and binary.
What does this tool do?
Bitwise operations are everywhere in low-level code: flags and masks, permissions, colour packing, hashing and network calculations. Results wrap to the chosen width using two's complement, exactly like fixed-size integers in C, Java or Go. 64-bit maths uses BigInt, so nothing is rounded.
Why use it?
- 8 to 64-bit.
- Signed or unsigned.
- Visual bit grid.
The formula
Arithmetic shift >> keeps the sign bit
Logical shift >>> fills with zeros
NOT a = −a − 1 (two's complement)
Privacy
The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved. There's no account to create and nothing to install.
Last reviewed by the M2Toolkit team.