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

Binary to readable text

Binary data itself is not readable, and only after it is restored to text can we judge whether the content is correct. This step is often used at the end of the debugging link: get the original bytes and restore them first to take a look.

📌 What do you usually look at first after restoring?

  • Do the first few characters comply with the protocol?
  • Whether expected keywords appear, such as status and error codes
  • Whether the end is complete and whether there are any truncated garbled characters

⚙️ Actual measurement example

01010111011001010110110001100011011011110110110101100101 will be restored to Welcome, prompting a total of 7 bytes, and the number of bytes is consistent with the number of characters (pure ASCII case).

🧭 The order of troubleshooting when results are unsatisfactory

First confirm that the number of bits is a multiple of 8, then confirm the byte order (whether it is segmented or prefixed), and finally check whether the encoding is UTF-8. In three steps, the cause of most garbled codes can be located.

📌 The difference between garbled characters and truncation

If the entire paragraph is unreadable, it is mostly due to encoding mismatch; if only one or two characters at the end are garbled, it usually means that the data has been truncated. The former requires changing the data source, while the latter only needs to fill in the missing bytes.

All keywords and tutorials 12

❓ FAQ

Is it normal to have garbled characters in the results?
Occasionally, it appears that the byte sequence is not legal UTF-8. The common reason is that the data is truncated or the encoding is not UTF-8; please check the data source rather than converting repeatedly.
Can the original paragraph structure be retained?
Can. Line breaks and spaces are ordinary bytes and will be restored normally, so the paragraphs and indents of the original text appear in the result as they are.
Why are there line breaks in the results?
Because the newline character of the original text is also encoded into bytes (usually 00001010), the newline character will naturally be brought back after restoration, which is a normal result.