Home › Code and dev › Unicode Converter
🔧

Unicode Converter

Convert between Chinese text and Unicode escapes in hex or decimal form

输入中文文本

About this tool

The Unicode converter switches between readable text and Unicode escape sequences in both directions:

  • Text to Unicode: turn each character into a \uXXXX hex escape
  • Unicode to text: restore \uXXXX sequences back to characters
  • Decimal mode: output decimal HTML character references instead
  • ASCII scope: convert only non-ASCII characters or everything

What Unicode escapes are

An escape sequence is a way to represent a Unicode character in source code. JavaScript uses the \uXXXX form, while HTML uses a numeric character reference. Both are useful when only ASCII can be transported.

When to use it

  • Handle non-ASCII text inside JavaScript code
  • Prepare i18n resource files
  • Encode text inside JSON payloads
  • Work with HTML character references

Notes

  • \uXXXX: the JavaScript and Java escape form with four hex digits
  • HTML references: decimal numeric references used on web pages
  • BMP range: U+0000 to U+FFFF, where most common characters live
  • CJK range: Chinese characters sit mostly in U+4E00 to U+9FFF