Unicode Escape Unescape Online - Free Unicode Converter Tool

Unicode Escape / Unescape

<link rel="canonical"> · <meta name="description">

Input Text
Output
(Output will appear here)

What is Unicode?

Unicode is a universal character encoding standard that assigns a unique number to every character across all languages and writing systems in the world. From the English letter "A" to the Chinese character "中" to the emoji "🎉", Unicode ensures that computers can consistently represent and process text regardless of platform, software, or language.

Understanding Unicode Escape Sequences

Unicode escape sequences represent characters using their hexadecimal code point. For example, the Chinese character "你" has the code point U+4F60, which can be written as the escape sequence \u4F60 in JavaScript strings or as 你 in HTML. Escape sequences are particularly useful when you need to represent non-ASCII characters in environments that only support ASCII.

JavaScript Unicode Escaping

In JavaScript, you can escape Unicode characters using the \uXXXX format for BMP characters (U+0000 to U+FFFF) or the \u{XXXXX} format for supplementary characters. This is essential when working with JSON, programming strings, or any context where special characters might cause parsing issues.

  • \u0041 → "A" (Latin capital letter A)
  • \u4F60 → "你" (Chinese character)
  • \u{1F600} → "😀" (Grinning face emoji)

UTF-8 vs UTF-16 vs UTF-32

Unicode defines the mapping between characters and code points, but different encoding schemes represent those code points differently in bytes. UTF-8 uses 1-4 bytes per character and is the most common encoding for web content. UTF-16 uses 2-4 bytes and is used internally by JavaScript strings. UTF-32 uses a fixed 4 bytes per character.

Why Unicode Matters for Internationalization

Before Unicode, different systems used conflicting character encodings, causing乱码 (mojibake) when text was viewed on systems using different encodings. Unicode solved this by providing a single, unified character set. Today, virtually all modern software supports Unicode, making it possible to mix languages, symbols, and emoji in a single document.

FAQ

What's the difference between Unicode escape and HTML entity encoding?Unicode escapes (like \u4F60 or 你) represent characters by their Unicode code point. HTML entities (like < for < or & for &) are specifically for characters that have special meaning in HTML. They serve different purposes and use different syntax.
Does this tool support emoji?Yes! This tool fully supports all Unicode characters including emoji. For emoji outside the Basic Multilingual Plane (characters above U+FFFF), use the \u{XXXXX} format for JavaScript or the proper surrogate pair representation.
Why are some characters shown as surrogate pairs?JavaScript originally used UTF-16 internally, which represents characters above U+FFFF using surrogate pairs (two 16-bit values). Our unescape function handles this correctly and produces the actual Unicode characters you expect.
Is my text sent to your servers?No. All Unicode conversion happens entirely in your browser using JavaScript. Your text never leaves your device.