Binary Bit Inverter
Invert binary bits instantly - flip 0s to 1s and 1s to 0s. Supports arbitrary bit lengths with decimal, hex, and complement outputs.
About
Bitwise inversion (NOT operation) flips every bit in a binary word: each 0 becomes 1 and each 1 becomes 0. The result is the one's complement of the input. This operation underpins error-detection checksums, subnet mask derivation in networking, and two's complement arithmetic used by every modern CPU. A single misflipped bit in a checksum or bitmask can corrupt packet routing or cause signed-integer overflow. This tool processes arbitrary-length binary strings - not capped at 32 or 64 bits - and reports the inverted output alongside its decimal and hexadecimal equivalents computed via BigInt arithmetic.
Limitation: the decimal and hexadecimal conversions treat the binary string as an unsigned integer. For signed interpretation, consult the two's complement row in the results panel, which assumes the leading bit is the sign bit. Pro tip: when inverting subnet masks, verify your input is a contiguous block of 1s followed by 0s - non-contiguous masks are technically valid in older RFCs but rejected by most modern routers.
Formulas
The bitwise NOT operator inverts each bit independently. For a binary string B of length n:
Equivalently, for each bit position i:
The unsigned decimal value of the inverted string is:
For two's complement (signed interpretation with n-bit width):
Where B is the original binary input, bi is the bit at position i (LSB = 0), n is the total bit count, and D is the resulting unsigned decimal value.
Reference Data
| Bit Width | Max Unsigned Value | NOT(0) Result | Common Use | One's Complement Range (Signed) |
|---|---|---|---|---|
| 4 bits (nibble) | 15 | 1111 | Hex digit, BCD | −7 to +7 |
| 8 bits (byte) | 255 | 11111111 | ASCII, subnet octets | −127 to +127 |
| 12 bits | 4095 | 111111111111 | ADC resolution | −2047 to +2047 |
| 16 bits (word) | 65535 | 1111111111111111 | TCP/UDP checksum, UCS-2 | −32767 to +32767 |
| 24 bits | 16777215 | 111...1 (24) | RGB color, audio sample | −8388607 to +8388607 |
| 32 bits (dword) | 4294967295 | 111...1 (32) | IPv4 address, int32 | −2147483647 to +2147483647 |
| 48 bits | 281474976710655 | 111...1 (48) | MAC address | - |
| 64 bits (qword) | 18446744073709551615 | 111...1 (64) | int64, memory address | −9.22×1018 to +9.22×1018 |
| 128 bits | 3.40×1038 | 111...1 (128) | IPv6, UUID, AES key | - |
| 256 bits | 1.16×1077 | 111...1 (256) | SHA-256 hash | - |
| 512 bits | 1.34×10154 | 111...1 (512) | SHA-512 hash | - |
| 1024 bits | ~10308 | 111...1 (1024) | RSA key (legacy) | - |