Integer NOT Calculator

Computes the bitwise NOT (unsigned complement) of each non-negative integer in a list independently, at a chosen 8, 16, or 32-bit width, printing one result per line. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-27

Overview

Introduction

This tool computes the bitwise NOT of each integer in your list independently, flipping every bit within a bit width you choose.

Pick 8, 16, or 32 bits and get the unsigned complement of every value, one result per line.

What Is Integer NOT Calculator?

A calculator that applies the bitwise NOT (complement) operation to each non-negative integer in a list, one at a time.

The result at width W is always (2^W - 1) minus the value, keeping the output as an unsigned number within that width.

How Integer NOT Calculator Works

Each non-blank line is parsed as a non-negative integer that must fit within the selected bit width's range.

For a chosen width W, the tool computes the mask (2^W - 1) and subtracts each value from it, which is equivalent to flipping every bit in the value's W-bit representation.

Each result is printed on its own line, in the same order as the input.

When To Use Integer NOT Calculator

Use it to compute the complement of a set of flag or mask values at a specific bit width, such as inverting an 8-bit permission mask.

It's also useful for teaching how bitwise NOT behaves differently at different widths, since the same input can NOT to very different outputs.

Features

Advantages

  • Lets you choose the exact bit width (8, 16, or 32) instead of assuming a fixed width.
  • Processes an entire list of values independently in one pass.
  • Always returns a clean unsigned result, avoiding confusing negative numbers from a signed complement.

Limitations

  • Only supports non-negative integers that fit within the chosen width; values outside that range are rejected rather than silently truncated.
  • Does not offer a signed two's-complement mode, only the unsigned complement within the width.

Examples

NOT at the default 32-bit width

Input

0

Output

4294967295

At 32 bits, NOT of 0 flips every bit to 1, giving the maximum 32-bit unsigned value.

NOT at an 8-bit width

Input

5
255

Output

250
0

At 8 bits, NOT of 5 is 255 - 5 = 250, and NOT of 255 (all bits set) is 0.

Best Practices & Notes

Best Practices

  • Choose the bit width that matches the system or format you're working with, since results differ across 8, 16, and 32 bits.
  • Keep every input value within the selected width's range to avoid rejection errors.

Developer Notes

Rather than relying on JavaScript's signed 32-bit `~` operator (which would need extra handling at 8/16-bit widths), each result is computed directly as `mask - value` where `mask = 2**width - 1`, which is mathematically equivalent to flipping every bit in an unsigned W-bit number.

Integer NOT Calculator Use Cases

  • Inverting a bitmask or permission flag set at a specific bit width
  • Exploring how bitwise NOT results change across 8, 16, and 32-bit widths
  • Verifying a bit-complement routine in firmware or low-level application code

Common Mistakes

  • Forgetting to set the intended bit width before reading the result, since the same input NOTs differently at each width.
  • Entering a negative number, which bitwise NOT here does not support.
  • Entering a value too large for the chosen width, such as 300 at an 8-bit width (max 255).

Tips

  • If you need the complement of a combined mask instead of individual values, fold your list with AND/OR/XOR first, then NOT the single result.
  • Use the NAND, NOR, or XNOR calculators if you want the fold-then-NOT behavior in a single step.

References

Frequently Asked Questions