Before programs had booleans and sets, they had bits, and bitwise operations are still the fastest, most compact way to manipulate flags, masks, permissions, and hardware registers. AND clears bits, OR sets them, XOR toggles them, NOT flips them all, and shifts move them left or right, which is multiplication or division by powers of two. A single integer can hold 32 independent yes/no flags, and one AND can test a flag without touching the others. This tool computes all five operations on integers you supply and shows the result in decimal, binary, and hex, so you can see exactly which bits moved and why. It is the fastest way to build intuition for the operations that underlie file permissions, graphics, cryptography, and embedded programming.
Quick Answer: Enter 12 AND 10 and the tool returns 8, because only the 8-bit is set in both.
Free Online Tool
Bitwise Operation Calculator
Compute AND, OR, XOR, NOT, and bit shifts on integers — with binary shown so you can see every bit move.
Shifts are fast multiply/divide by powers of two; NOT flips every bit, so NOT 0 is -1 in two’s complement.
How to Use the Bitwise Operation Calculator
- Enter your input in the tool above — for example, 12 AND 10.
- Choose any options the tool offers, such as the conversion direction or the settings that fit your case.
- Click the main button to run the tool and read the result it displays.
- Check the result against what you expected, then adjust the input and run it again if needed.
- Copy the output into your own document, code, or configuration wherever you need it.
Worked Example
Try it with 12 AND 10: the tool returns 8, because only the 8-bit is set in both. That example is a good first test whenever you use the tool, because it confirms you entered the input in the expected format before you trust it with your real values. This tool is built for working with flags, masks, permissions, and hardware registers, and the worked example shows the shape of a correct result so you can recognize a wrong one at a glance.
Key Features
- Runs entirely in your browser — nothing you type is uploaded anywhere.
- Built for working with flags, masks, permissions, and hardware registers, with the result shown immediately and in full.
- No account, no sign-up, and no software to install.
- Clear error messages when an input is incomplete or in the wrong format.
- Free to use as often as you like, for study, work, or checking homework.
Best Practices and Tips
- Start with the worked example in the guide, then substitute your own values.
- Double-check units and formats before trusting a result — most tool errors are input errors.
- Keep a note of the exact inputs that produced a result you rely on, so you can reproduce it.
- For anything important, cross-check with a second method or a known test value.
- Bookmark the tool if you use it regularly, so the same workflow is always one click away.
Common Mistakes to Avoid
- Confusing logical operators (&&, ||) with bitwise operators (&, |).
- Forgetting that NOT flips all bits, so NOT 0 is -1 in two complement, not 1.
- Copying a result without checking it against a known example first.
- Assuming the tool knows your context — it only sees the values you enter.
When This Tool Helps — and When It Doesn’t
This tool helps most when you need a fast, checkable answer for working with flags, masks, permissions, and hardware registers and you can verify the result against a known example. It does not replace professional judgment: for decisions with real consequences, treat the output as one input among several, verify it independently, and remember that the tool can only work with exactly what you enter. Used that way — quick check, verified result, human decision — it saves time without creating false confidence.
Frequently Asked Questions
How do I test whether a flag is set?
AND the value with a mask containing only that flag bit. If the result is nonzero, the flag is set. This works because AND keeps only bits that are set in both operands.
What is XOR used for?
Toggling bits, comparing values (equal values XOR to zero), and simple checksums and ciphers. XOR is reversible: applying the same XOR twice restores the original.
Why are shifts faster than multiplication?
Shifting left by n multiplies by 2 to the power n using a single hardware operation instead of a multiplication circuit. Compilers exploit this automatically, but hand-written bit code relies on it constantly.
Related Tools
- Quoted-Printable Encoder / Decoder – Encode text to MIME quoted-printable form, or decode it back to plain text
- UTF-8 Byte Counter – Count the UTF-8 bytes your text really occupies, distinct from its character count
- Base58 Encoder / Decoder – Encode text to Base58 or decode Base58 back to text, using the Bitcoin alphabet
