Hongmu Notes

💾 Binary to string

Paste the continuous 8-digit binary string and restore it to text with one click.

Binary to string

Instructions for use

  • Every 8 bits correspond to a byte, and the number of bits must be a multiple of 8
  • Can contain spaces and line breaks. After pasting, the spaces will be automatically removed and then split.
  • Decode the byte sequence according to UTF-8, and both English numbers and Chinese can be restored

Byte string to text

"Byte string to text" and "decoding" are the same thing: converting a string of bytes into characters according to encoding rules. The difference is only in the perspective of presentation - the former emphasizes the data form, and the latter emphasizes the reduction process.

📌 Bytes and characters are not one-to-one

English and numbers are 1 byte and 1 character, and Chinese characters are 3 bytes and 1 character under UTF-8. Therefore, "N bytes restored in total" is an accurate prompt, and the number of characters may be less. The actual measured "Chinese" is 6 bytes and 2 characters.

⚙️ Common data sources

  • Binary fields copied from network capture packets
  • Raw data output from the serial port of the embedded device
  • Fixed-length binary string output by the encoding tool

🧭 Verification after restoration

First check whether the beginning is as expected (such as the fixed header of the message), and then check whether the end is complete. If garbled characters appear at the end, the data is usually truncated and needs to be completed before decoding.

📌 Verification after copying results

After pasting the results to the target system, it is recommended to review the byte count prompt again to confirm that it is consistent with the length declared by the data source; this step can prevent most of the problems of "it looks correct but is actually missing a section".

All keywords and tutorials 12

❓ FAQ

Why are the number of bytes and words in the prompt different?
Because the character width is different. When it is pure English, the number of bytes is equal to the number of characters; when it contains Chinese, one character occupies 3 bytes, so the number of bytes is larger.
Can you specify GBK and other encodings?
This page is decoded as UTF-8. Binary strings in other encodings need to be converted to UTF-8 bytes first, or processed with tools that support encoding selection.
Why do question marks or squares appear in the results?
It means that this string of bytes is not a legal UTF-8 sequence, usually because the encoding does not match or the data is truncated. Please check the source encoding or confirm whether a piece of binary is missing.