Bitwise Calculator
AND/OR/XOR/shift — mixed dec/hex/bin input, exact wraparound per bit width.
What it does: Performs bitwise operations on two integers, with results in binary/decimal/hex.
When to use it: Tweaking bit masks, setting register bits, or parsing protocols.
MEANS The result is wrapped to the selected bit width; binary is the clearest form for inspecting individual bits.
No history yet. Each calculation is automatically saved to this device.
How to use the bitwise calculator
Enter numbers and pick an operation.
- 01
Enter the operands
Mix decimal,
0xhexadecimal and0bbinary freely. - 02
Pick operation and bit width
AND/OR/XOR/shift, etc.; the bit width determines wraparound and display width (8/16/32/64).
- 03
Read the result in three bases
Gives binary, hexadecimal and decimal results at once.
Common questions, answered in 3 minutes
What is the bit width for?
It determines how many bits the result wraps and displays in. For example, in 8 bits 0x80<<1 overflows back to 0x00, matching real register behavior.
Why does NOT depend on the bit width?
NOT inverts all bits, so the result depends on the bit width: in 8 bits ~0x00=0xFF, while in 32 bits it is 0xFFFFFFFF.
Is the shift arithmetic or logical?
This tool performs logical shifts (filling with 0) and masks to the bit width. Arithmetic right shift (preserving the sign) is handled separately.
Can it compute beyond 32 bits?
Yes, up to 64 bits; it uses BigInt internally for exact arithmetic and is not limited by JS 32-bit bitwise operations.
Standards and sources referenced by this tool
| Item | Value / Formula | Source |
|---|---|---|
| Bitwise operations | AND/OR/XOR/NOT/shift | Boolean bitwise operations |
Exact bitwise operations with BigInt, no external API.