Binary Reverser
Reverse binary bits, bytes, or full bit streams instantly. Supports binary, hex, decimal, and ASCII input with multiple reversal modes.
About
Bit ordering errors cause silent data corruption. A reversed byte in a network packet, a swapped nibble in an embedded register, or a wrong-endian integer in a file header can produce results that look plausible but are entirely wrong. This tool performs exact bitwise reversal on arbitrary binary data. It operates in three modes: full-stream reversal (all bits treated as one sequence), per-byte reversal (each 8-bit group reversed independently), and byte-order reversal (endianness swap without touching bit order within bytes). Input accepts raw binary strings, hexadecimal, decimal integers, or plain ASCII text. The output is computed via direct string manipulation on the canonical binary representation. No approximation occurs. The tool assumes unsigned integers and zero-pads to 8-bit boundaries when operating in byte-aware modes.
Limitations: maximum input length is 10,000 characters in any format. Negative integers are not supported directly. Feed two's complement binary manually if needed. For multi-byte ASCII, each character maps to its 8-bit code point (0 - 127). Extended Unicode above U+00FF is encoded as 16-bit units.
Formulas
Binary reversal is a deterministic string transformation. Given an input value converted to its canonical binary string B of length n, the three reversal modes are defined as follows:
Full-Stream Reversal: For binary string B = b0b1…bn−1, the reversed output B′ is:
B′ = bn−1bn−2…b0
Per-Byte Reversal: The binary string is zero-padded to a multiple of 8 bits, then split into bytes B0, B1, …, Bk. Each byte is reversed independently:
Bi′ = reverse(Bi) for i = 0, 1, …, k
Byte-Order Reversal (Endianness Swap): Bytes are reordered without modifying internal bit order:
B′ = Bk Bk−1 … B0
Where B = binary string, n = total bit count, bi = individual bit at index i, k = number of bytes − 1, and reverse() denotes string reversal. Format conversions use standard positional notation: binary to decimal via n−1∑i=0 bi ⋅ 2n−1−i, and hex via 4-bit nibble grouping.
Reference Data
| Input Format | Example Input | Binary Equivalent | Full Reverse | Per-Byte Reverse | Byte-Order Reverse |
|---|---|---|---|---|---|
| Binary | 10110010 | 10110010 | 01001101 | 01001101 | 10110010 |
| Binary (16-bit) | 10110010 01001101 | 1011001001001101 | 1011001001001101 | 01001101 10110010 | 01001101 10110010 |
| Hex | B2 | 10110010 | 01001101 | 01001101 | 10110010 |
| Hex (16-bit) | B2 4D | 1011001001001101 | 1011001001001101 | 01001101 10110010 | 01001101 10110010 |
| Decimal | 178 | 10110010 | 01001101 | 01001101 | 10110010 |
| Decimal | 45645 | 1011001001001101 | 1011001001001101 | 01001101 10110010 | 01001101 10110010 |
| ASCII | A | 01000001 | 10000010 | 10000010 | 01000001 |
| ASCII | Hi | 01001000 01101001 | 10010110 00010010 | 00010010 10010110 | 01101001 01001000 |
| Hex (32-bit) | DE AD BE EF | 11011110 10101101 10111110 11101111 | 11110111 01111101 10110101 01111011 | 01111011 10110101 01111101 11110111 | 11101111 10111110 10101101 11011110 |
| Binary | 1 | 00000001 | 10000000 | 10000000 | 00000001 |
| Binary | 11111111 | 11111111 | 11111111 | 11111111 | 11111111 |
| Decimal | 0 | 00000000 | 00000000 | 00000000 | 00000000 |
| Decimal | 255 | 11111111 | 11111111 | 11111111 | 11111111 |
| Hex | FF | 11111111 | 11111111 | 11111111 | 11111111 |
| ASCII | Z | 01011010 | 01011010 | 01011010 | 01011010 |