Bitwise NOT
Invert every bit of an integer's 32-bit form.
Description
Invert every bit of an integer's 32-bit form.
Bitwise NOT: Invert every bit of an integer's 32-bit form.
When to use Bitwise NOT
Use this operation to inspect or transform integer bit patterns in protocol fields, masks, flags, compact data structures, or programming exercises.
- A
- Operand to invert.
How Bitwise NOT works
Invert every bit of an integer's 32-bit form. The tool evaluates the supplied inputs together and returns the named outputs below; it does not infer omitted operating conditions or change the units shown.1
- Result
- Bitwise complement of the operand.
Limitations and assumptions
- JavaScript bitwise operators coerce values to signed 32-bit integers, and shift counts use only the low five bits. Decimal display can hide the two's-complement pattern, so inspect an unsigned or binary representation when individual bits matter.
- Use finite inputs in the displayed units and preserve more precision than the final presentation requires. Independently verify safety-critical, financial, compliance, or production decisions.
Alternative or Complementary approaches
Use explicit masks and a documented bit width. For values wider than 32 bits, use a BigInt-based implementation or a byte-array tool instead of relying on JavaScript number bitwise coercion.
References
-
Bitwise operation — Wikipedia contributors
Similar or alternative tools
- Bitwise Left Shift
Shift an integer's 32-bit form left by the given number of bits.
- Bitwise Right Shift
Shift an integer's 32-bit form right by the given number of bits, preserving the sign.
- Bitwise AND
Combine two integers with a bitwise AND on their 32-bit forms.