User Rating 0.0
Total Usage 0 times
0 characters
Examples:
Is this tool helpful?

Your feedback helps us improve.

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.

binary reverser bit reversal endianness swap binary converter reverse bits byte order binary tool

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 = b0b1bn1, the reversed output B is:

B = bn1bn2b0

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 Bk1B0

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 n1i=0 bi 2n1i, and hex via 4-bit nibble grouping.

Reference Data

Input FormatExample InputBinary EquivalentFull ReversePer-Byte ReverseByte-Order Reverse
Binary1011001010110010010011010100110110110010
Binary (16-bit)10110010 010011011011001001001101101100100100110101001101 1011001001001101 10110010
HexB210110010010011010100110110110010
Hex (16-bit)B2 4D1011001001001101101100100100110101001101 1011001001001101 10110010
Decimal17810110010010011010100110110110010
Decimal456451011001001001101101100100100110101001101 1011001001001101 10110010
ASCIIA01000001100000101000001001000001
ASCIIHi01001000 0110100110010110 0001001000010010 1001011001101001 01001000
Hex (32-bit)DE AD BE EF11011110 10101101 10111110 1110111111110111 01111101 10110101 0111101101111011 10110101 01111101 1111011111101111 10111110 10101101 11011110
Binary100000001100000001000000000000001
Binary1111111111111111111111111111111111111111
Decimal000000000000000000000000000000000
Decimal25511111111111111111111111111111111
HexFF11111111111111111111111111111111
ASCIIZ01011010010110100101101001011010

Frequently Asked Questions

Full-stream reversal treats the entire binary input as a single sequence and mirrors it end-to-end. Per-byte reversal pads the input to a multiple of 8 bits, splits it into 8-bit groups, and reverses each byte independently while keeping byte order intact. For a single byte, both produce the same result. For multi-byte data, results differ significantly. For example, 10110010 01001101 full-reversed becomes 1011001001001101, while per-byte reversed becomes 01001101 10110010.
Byte-order reversal (endianness swap) is used when converting data between big-endian and little-endian architectures. Network protocols typically use big-endian (network byte order), while x86 processors use little-endian. This mode rearranges whole bytes without touching the bit ordering within each byte. Use this when debugging protocol buffers, file format headers (e.g., TIFF, BMP), or cross-platform serialized data.
For per-byte and byte-order modes, the tool zero-pads the binary string on the left until its length is a multiple of 8. For example, input 101 (3 bits) becomes 00000101 (8 bits) before processing. Full-stream mode can operate on any length without padding, though a padding option is available. The padding is always shown in the output so you can verify the assumed bit width.
Yes. Enter the hex bytes from your file header (e.g., DE AD BE EF), select byte-order reversal mode, and the tool will output EF BE AD DE in hex. This is the exact operation performed by functions like htonl() and ntohl() in C networking libraries. Compare the reversed output against the format specification to verify correctness.
The tool accepts up to 10,000 characters of input in any format. Binary reversal is an O(n) string operation and completes in under 1 millisecond for typical inputs. For the maximum length (10,000 binary digits = 1,250 bytes), processing remains instantaneous. The bottleneck, if any, is DOM rendering of the formatted output, not the algorithm itself.
Not necessarily. Bit reversal preserves the number of 1-bits (Hamming weight), so the popcount remains identical. However, the numerical value changes unpredictably. The reversed value of an even number can be odd and vice versa, because parity depends on the least significant bit, which after reversal was formerly the most significant bit. The only values invariant under full reversal within a fixed bit width are binary palindromes (e.g., 10000001, 01011010).