Bitwise Calculator Online — Free Bitwise Calculator Tool

CodexFuse Team · 2026-10-26T15:46:28.214Z · 9 min read min read

Compute AND, OR, XOR, NOT and bit shifts on 32-bit numbers with CodexFuse's free bitwise calculator — decimal and hex results, plus a worked example.

A bitwise calculator works on the individual bits inside a whole number instead of treating the number as one value. It compares bits, flips bits, or moves bits left and right, and it shows the result in decimal and hex. That makes it the right tool when a single number carries several yes-or-no flags, settings, or states packed together.

CodexFuse's free bitwise calculator handles unsigned 32-bit integers. Enter two whole numbers, pick an operation, and get a decimal and hex result in your browser.

What does a bitwise calculator actually do?

A bitwise calculator applies one operation to each matching pair of bits in two numbers and returns the new number those bits form. AND keeps a bit only when both inputs have it, OR keeps it when either has it, XOR keeps it when they differ, NOT flips every bit, and shifts move bits left or right.

The key idea is place value. In binary, 12 is 1100 and 10 is 1010, so comparing them bit by bit gives a new pattern, not a sum. That is why 12 AND 10 is 8, while 12 + 10 is 22.

Pro Tip

Read a result in binary, even when the tool shows decimal and hex. Write 12 as 1100 and 10 as 1010 side by side, and the AND, OR, and XOR results stop looking like magic.

How do AND, OR, XOR, NOT and shifts differ in practice?

Each bitwise operation answers a different question about the same bits. AND tests for overlap, OR combines, XOR finds differences, NOT inverts, and shifts scale by powers of two. Picking the wrong one is the most common source of a wrong flag value.

OperationQuestion it answersExample
ANDWhich bits do both numbers share?12 AND 10 = 8
ORWhich bits does either number have?12 OR 10 = 14
XORWhich bits differ between the numbers?12 XOR 10 = 6
NOTWhat is the opposite of every bit?NOT 12 = 4,294,967,283
Left shiftWhat happens when bits move left?3 << 2 = 12
Right shiftWhat happens when bits move right?255 >> 4 = 15

AND is how you mask bits out. If you only care about one flag, AND the value with that flag's bit and check whether the result is that bit or zero. OR is how you set bits: OR a value with a flag and that flag turns on without disturbing the others.

NOT needs extra care here. It flips all 32 bits and stays unsigned, so NOT 12 is 4,294,967,283, not −13 — the value JavaScript's signed ~ operator returns. Confusing the two is a classic debugging trap.

Worked example: checking permission flags without guessing

Maya is a junior developer at a small software firm. A user cannot export a report — the button stays greyed out. The user's permission code is 12; the export feature requires 10. Maya must find out what the user holds, and what the combined code should be.

She opens the bitwise calculator, enters A = 12 and B = 10, picks AND, and clicks Calculate. It returns Result = 8 (0x8): the overlap is only 8, not the full 10, so one required permission is missing. In binary, 12 is 1100 and 10 is 1010, and only the 8-bit is set in both.

Next she picks OR with the same inputs. It returns Result = 14 (0xE): 1100 OR 1010 is 1110. Grant the missing permission and the stored code becomes 14, so the export check passes. A quick check, 3 << 2 = 12, confirms the tool behaves as expected.

The check takes under a minute and gives Maya a precise fix: grant the missing permission so the code becomes 14.

Important

Never edit a live permission or feature-flag value on the strength of a single calculation. Test the new code in a staging account first, and confirm which bit means what in your own system — bit meanings are a convention your code defines, not a universal standard.

How do you use the CodexFuse bitwise calculator?

The tool follows the steps printed on its own page, and it takes less than a minute once you know your two numbers, with no setup needed. You work in decimal only, and the result appears in both decimal and hex.

  1. Enter number A: type a whole number from 0 to 4,294,967,295. Commas are allowed, so 1,000 reads as 1000.
  2. Enter number B: type the second number, unless you picked NOT, which uses A only.
  3. Pick the operation: choose AND, OR, XOR, NOT, left shift, or right shift.
  4. Click Calculate: read the result in decimal and hex, then copy it in one click as Result = N (0xHEX).
  5. Try a preset first if you are unsure: 12 AND 10, 12 OR 10, and 3 << 2 confirm the tool's behaviour before your own values.
Debugging flags while your server still needs babysitting?

If permission bugs are not your only headache — slow hosting, missed updates, and security worries eat the same workday — move the app to CodexFuse and let a managed team handle the hosting, fully managed, on pay-as-you-go credits.

Get Started with CodexFuse

Where do developers actually use bitwise operations?

Bitwise work shows up wherever packing several flags into one number saves memory or code. That includes permission systems, hardware registers, graphics, network masks, and compact app state, where one integer carries several yes-or-no settings at once instead of a separate field for each one.

  • Feature and permission flags: one integer stores read, write, export, and admin rights, tested with AND.
  • Hardware and device registers: single bits switch a sensor or mode on and off.
  • Graphics and colour values: colour channels packed into one number, pulled out with shifts and masks.
  • Network masks and checksums: AND isolates a network address; XOR detects changed bits.
  • Compact game and app state: levels, toggles, and options fit in one small, cheap value.

What this calculator will not do — and what to use instead

This tool is deliberately narrow, and its limits matter more than its features when you are deciding whether to trust a result. It works on unsigned 32-bit integers only, in decimal input only, with six operations: AND, OR, XOR, NOT, left shift, and right shift.

  • No hex or binary input: type 255, not 0xFF or 0b11111111. Convert first if your value starts life in another base.
  • No NAND, NOR, XNOR, or rotate: combine the six operations or use a dedicated tool instead.
  • Shift amounts are 0 to 31 only: anything larger is rejected, because a 32-bit shift beyond 31 has no meaningful result here.
  • No negative or oversized numbers: below 0 or above 4,294,967,295 is rejected; decimals are truncated.
  • No signed NOT: NOT here never returns a negative number, which differs from signed languages and must be accounted for in your code.

For XOR on hex, binary, or text, use the XOR calculator instead. For turning a binary string back into readable text, the binary-to-text tool covers that step. And if you are unsure what a bit count means in bytes, the bits-to-bytes tool converts between the two.

Suggested Reading

If you work with binary values often, read the binary converter guide and the binary calculator guide next — they cover the conversions this tool assumes you have already done.

Why the hosting around your code matters as much as the code

Maya's permission bug took a minute to diagnose but half a day to ship, because the staging server needed patching first and nobody was sure the last backup had run. That server work is what a developer should not have to babysit.

The workflow is straightforward. Move the app's hosting to CodexFuse's managed platform, where the team handles server patching, security monitoring, and backups while you keep building. You pay with credits on a pay-as-you-go basis, with no subscription and no lock-in. If the app grows, you scale the managed hosting or VPS behind it rather than rebuilding your setup.

Stop guessing at bits — check them, then fix the real problem

Open the bitwise calculator now, enter your two numbers, and run the AND, OR, and shift checks before you change a single flag in production. Test the corrected value in staging before you ship it. And if server babysitting is stealing hours you need for that work, move your hosting, business email, and security to CodexFuse today — fully managed, on credits, with no subscription holding you in place.

Frequently Asked Questions

What is a bitwise calculator?

It compares, flips, or moves the individual bits of whole numbers. AND, OR, and XOR work bit by bit across two numbers, NOT flips every bit of one number, and shifts move bits left or right.

What is 12 AND 10, and why is it 8?

12 AND 10 is 8. In binary, 12 is 1100 and 10 is 1010, and AND keeps a bit only when both numbers have it. Only the 8-bit is set in both, so the result is 1000 = 8.

Why is NOT 12 not −13 in this tool?

This tool uses unsigned 32-bit numbers, so NOT flips all 32 bits and stays in range, giving 4,294,967,283. The value −13 comes from signed arithmetic, as in JavaScript's ~ operator.

What numbers can I enter?

Whole numbers from 0 to 4,294,967,295, in decimal only. Commas are allowed; decimals are truncated. Negatives, hex, binary, and oversized values are rejected.

How do bit shifts work?

Left shift fills with zero on the right, multiplying by a power of two: 7 << 2 = 28. Right shift here is logical: 255 >> 4 = 15. Shift amounts must be 0 to 31.

Is the bitwise calculator free?

Yes. It runs entirely in your browser, so nothing you type is uploaded or stored, and the copy button gives the result in one click.