Hongmu Notes

🈹 Convert text to hexadecimal

Convert the code point of each character to lowercase hexadecimal and concatenate.

Instructions for use

  • Automatic conversion after entering or pasting text, you can also click "Convert" to perform it again
  • The output is lowercase hexadecimal without inserting delimiters: ASCII 2 digits, Chinese characters usually 4 digits
  • The status line gives the number of code elements and output digits for easy verification.

What can this tool do?

  • Convert the code points of each character into lowercase hexadecimal and concatenate them in order
  • Chinese characters generally have 4 digits, alphanumeric characters and half-width punctuation characters have 2 digits.
  • Convert while inputting, the status line gives the number of characters and the number of output digits
  • The results can be copied with one click, and the original text will not be altered.

Actual measurement effect

inputoutput
a61
hello60a8597d
ab6162

Lowercase hexadecimal, no delimiters, direct concatenation in character order.

Usage tips

  • Encoded values that need to be separated by spaces can be viewed in segments using the "Text to Binary" tool.
  • To restore it to text, please use a "16-to-string" tool and fill in the separation
  • The code points of half-width and full-width characters are different, and the number of resulting digits is naturally different.

All keywords and tutorials 12

❓ FAQ

how it is converted
Write the UTF-16 code point of each character in lowercase hexadecimal, and then spell it out directly in order. For example, "Hello" gets 60a8597d, and a gets 61.
Why are the lengths different?
Small character code points only output 1 or 2 digits, and large ones output 4 digits, because the original implementation does not pad zeros: the letter a is 61, the space is 20 (2 digits), the newline is a, the tab character is 9 (code points less than 16 only have 1 digit), and Chinese characters are generally 4 digits (you are 60a8). Therefore, the splicing result needs to be parsed by itself bit by bit, and the original implementation does not insert delimiters.
What happens to emojis?
The emoji consists of two code elements (surrogate pairs), which will be converted into two segments of 4-digit hexadecimal, for example, 😀 gets d83dde00. It is consistent with the common writing method of "UTF-16 encoded value".
Will the data be uploaded?
No. The conversion is completed locally in the browser, and the input and results do not pass through the server or be written to local storage.