By Debmedia Technologies LLP · Kolkata, India · Updated
What Is It and When Do You Need It?
Bitwise operations work on the individual bits of numbers. They are used for flags, masks, permissions, graphics and low-level protocols. Doing them by hand means converting to binary, which is slow and error-prone.
Enter two numbers and choose an operation to see the bits.
How to Use This Tool
- Enter numbers in decimal, hex (0x) or binary (0b).
- Choose the operation and the bit width.
- Press Calculate.
- Read the binary, hex, decimal and signed results.
How the Calculation Works
Both inputs are read as big integers and masked to the chosen width, using two’s complement for negatives. The operation is applied to the whole word. NOT flips every bit within the width. Shifts move the bits and drop those that fall outside the width. The signed value treats the top bit as negative.
Worked Example
202 AND 15 in 8 bits: 11001010 AND 00001111 = 00001010, which is 10 (0x0A). 202 XOR 255 is 53.
Common Uses
- Flags and permission masks.
- Networking and subnet masks.
- Embedded and low-level code.
- Learning binary maths.
Tips and Common Mistakes
- Use hex for masks, it lines up with the bits.
- Shifting left by 1 doubles a number.
- Check the width: 8-bit and 32-bit results differ for NOT.
Related Tools
Next, you may need the IEEE 754 converter, checksum calculator, ASCII table, semver comparator.
Everything runs in your browser. Nothing you type is uploaded, stored or sent to any outside service.
Frequently Asked Questions
Disclaimer: results are calculated in your browser from the numbers you enter. Check important results before you rely on them for money, health, safety or legal decisions.