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.
Use cases
- Work with flags, masks and permissions.
- Check overflow at fixed integer sizes.
- Learn binary maths for exams and interviews.
A = 12 (1100), B = 10 (1010), 8-bit
Each operation works bit by bit:
| Operation | Binary | Decimal |
|---|---|---|
| A AND B | 1000 | 8 |
| A OR B | 1110 | 14 |
| A XOR B | 0110 | 6 |
| NOT A (unsigned) | 11110011 | 243 (−13 signed) |
| A << 1 | 11000 | 24 |
Common mistakes
- Forgetting that NOT depends on the bit width.
- Using arithmetic right shift when you meant logical (or the other way round).
- Mixing signed and unsigned interpretations of the same bits.
The formula
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.
Frequently asked questions
What is two's complement?
The usual way to store negative integers: invert the bits and add one.
Can I enter hex or binary?
Yes, use 0x for hex, 0b for binary and 0o for octal.
Are 64-bit results exact?
Yes, they use BigInt, so nothing is rounded.
Content last updated . See how M2Toolkit works.