Bitwise Calculator

Client-sideNo sign-upFree

Run AND, OR, XOR, NOT, and bit-shift operations, with results in decimal, binary, and hex.

How this tool works

1

Choose an operation

AND, OR, XOR, NOT, left shift, or right shift.

2

Enter A (and B, if needed)

NOT and shifts use fewer inputs than AND, OR, and XOR - the form adjusts to match.

3

Check each input's bit pattern

Binary and hex for A and B show up live as you type, before the operation even runs.

4

Read the result three ways

Decimal, binary, and hex all appear together, no separate conversion step needed.

Quick facts

Category
Calculators
Best for
Checking a flag-mask or permission-bit calculation while debugging
A (decimal)
Binary: 1100 · Hex: C
B (decimal)
Binary: 1010 · Hex: A
✓ Calculated
Decimal
8
Binary
1000
Hex
0x8
In-content slot

About this tool

Enter two integers and run a bitwise operation - AND, OR, XOR, NOT, left shift, or right shift - the same low-level operations used for flag masking, permission bits, color channel packing, and other bit-level manipulation in real code. Both inputs show their binary and hex representation alongside the decimal value you typed, so you can see exactly which bits are set before the operation runs, and the result appears in all three formats at once rather than requiring a separate conversion step afterward. NOT and the shift operations only need a single input where that's all the operation requires - NOT flips every bit of A alone, while a shift moves A's bits left or right by the amount in B. All operations use standard 32-bit integer semantics, matching how bitwise operators behave in JavaScript and most C-family languages. Runs entirely client-side.

Why use this tool

All six core operations

AND, OR, XOR, NOT, and both shift directions in one tool, not scattered across separate calculators.

Three output formats at once

Decimal, binary, and hex all shown together, instead of converting the result by hand afterward.

See input bit patterns live

Each input's binary and hex representation updates as you type, before you even run the operation.

Standard 32-bit semantics

Matches how bitwise operators actually behave in JavaScript and C-family languages, not a simplified approximation.

Frequently asked questions

NOT is a unary operation - it flips every bit of a single value, so a second input wouldn't mean anything. The shift operations technically use two inputs (A is the value being shifted, B is how many positions to shift it), while AND, OR, and XOR are binary operations that combine two full values bit by bit - the form only shows the inputs each operation actually uses.

Results are shown using standard 32-bit integer semantics, the same behavior JavaScript's bitwise operators use internally and that most C-family languages share. The binary and hex displays show the unsigned representation of that 32-bit result, which is why NOT on a positive number can display as a long string of mostly 1s - it's the bit pattern of a negative number in two's complement form, just shown as unsigned bits.

Common uses include flag masking (packing several true/false settings into a single integer and checking one with AND), permission systems (Unix file permissions are a classic example), toggling individual bits with XOR, and packing multiple small values - like RGB color channels - into one number using shifts and OR. They're also common in performance-sensitive code, since bitwise operations are typically faster than the equivalent arithmetic.

Explore more free tools

Formatters, converters, validators, and generators - all free and running entirely in your browser.

Browse more tools