Unicode Encode & Decode

How Unicode Encoding Works

Each character is converted to its Unicode code point in hexadecimal format.

  1. 1

    Get code point

    Each character's Unicode code point value is retrieved.

  2. 2

    Format as escape sequence

    The code point is formatted as \uXXXX (4-digit) or \u{XXXXX} for supplementary characters.

FAQ

What is Unicode escape encoding?
Unicode escape encoding represents each character as a backslash-u followed by its hexadecimal code point (e.g., \u0041 for "A"). Characters beyond the BMP use the \u{XXXXX} syntax.
What is the difference between \uXXXX and \u{XXXXX}?
\uXXXX uses exactly 4 hex digits and can only represent code points up to U+FFFF (BMP). \u{XXXXX} is the ES6 syntax that supports any code point, including those beyond the BMP like emoji.

Related Tools