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 sequence to string

When doing data verification, "how many bytes are restored" is often more critical than the characters themselves: it can be directly compared with the length field in the message header to quickly determine whether the data is complete.

📌 How to use bytes

The status line will prompt "N bytes restored." Compare N with the length declared by the data source: consistent indicates that the data is complete, less indicates that the data has been truncated, and more indicates that excess content has been mixed in.

⚙️ Actual measured byte count comparison

inputTips
01001000011010012 bytes restored
1110010010111000101011013 bytes have been restored, corresponding to one Chinese character
Welcomeof 56-bit binary7 bytes restored

🧭 Benefits of contrasting with length fields

Looking at the byte count first and then the content can avoid repeatedly studying the source of garbled code when the data itself is incomplete, and the direction of troubleshooting will be clearer.

📌 Byte count rules for multi-byte characters

One Chinese character under UTF-8 is 3 bytes, and the corresponding binary number of 3 bytes is 24 bits. Therefore, when you see an integer multiple of 24 bits, you can expect that the result will contain Chinese characters. This rule facilitates quick prediction.

All keywords and tutorials 12

❓ FAQ

What to do if the number of bytes is inconsistent with the length of the string
When Chinese is included, the two are inherently inconsistent (one Chinese character is 3 bytes). Only in pure ASCII is the number of bytes equal to the number of characters. This rule can be used to quickly determine the content type.
Why not do auto-completion?
Automatic completion can hide the fact that the data is incomplete and may also cause misalignment. The tool selects an error and prompts the difference, leaving the judgment to you.
How many characters can be restored from a piece of binary?
When using pure ASCII, the length divided by 8 is the number of characters; when containing multi-byte characters such as Chinese, the number of characters will be less than the number of bytes, and the page will prompt "N bytes in total".