How to Encode and Decode Unicode
Choose Encode or Decode
Click the Encode tab to turn text into escape sequences, or the Decode tab to turn escape sequences back into readable text. Switching tabs clears both boxes so the input and output always match the mode you are in.
Type or paste your input
In Encode mode, enter any text containing accents, symbols, or non-Latin characters. In Decode mode, paste sequences such as é or \U0001F600. Conversion runs as you type, with no convert button to press.
Copy or clear the result
The output area updates instantly. Click Copy Result to send the output to your clipboard, or Clear to empty both boxes and start again. All conversion happens locally in your browser.
What Each Mode Does
The encoder only escapes characters above code point 127, so plain ASCII text passes through untouched and stays readable. The decoder reverses both four-digit and eight-digit escape forms. The table below shows how specific inputs are handled.
| Input | Mode | Output | Why |
|---|---|---|---|
| Hello | Encode | Hello | All characters are ASCII (code 0 to 127), so nothing is escaped. |
| caf with accented e | Encode | café | Only the accented letter is above 127, so only it becomes \uXXXX. |
| An emoji such as a grinning face | Encode | 😀 | Characters beyond U+FFFF are emitted as a UTF-16 surrogate pair. |
| € | Decode | The euro sign | A four-digit \uXXXX sequence maps to one code point. |
| \U0001F680 | Decode | A rocket emoji | An eight-digit \UXXXXXXXX sequence is converted, including astral code points. |
| Price 10 | Decode | Price 10 | Text with no escape sequences is returned unchanged. |
When This Tool Helps
Embedding text in source code
Encode mode produces \uXXXX sequences that paste safely into JavaScript, Java, JSON, and other formats that accept this syntax, keeping non-ASCII characters intact in ASCII-only files.
Reading escaped strings
When a log line, config value, or API response contains \uXXXX escapes, Decode mode turns them back into the characters they represent so you can see the real content.
Inspecting hidden characters
Encoding reveals exactly which characters are non-ASCII and what their hex code points are, which helps when tracking down a stray symbol or an unexpected accented letter.
Quick offline conversions
Because conversion runs in JavaScript on the page, it works after the page has loaded even without a connection, which suits one-off checks while you work.
Common Problems and Fixes
My ASCII text was not escaped
That is expected. Only characters above code point 127 are converted. Letters, digits, and common punctuation in the basic ASCII range are left unchanged so the output stays readable.
An emoji turned into two \uXXXX sequences
Characters beyond U+FFFF are stored as a UTF-16 surrogate pair, so encoding outputs two four-digit escapes. This is the same form most programming languages use and decodes back correctly.
My escape sequence did not decode
The decoder recognizes \uXXXX with exactly four hex digits and \UXXXXXXXX with exactly eight. Make sure the backslash, the case of the u, and the digit count match one of those forms, and that hex digits are 0-9 or A-F.
Output is empty or stale
Conversion updates as you type in the input box, not the output box. If nothing appears, confirm you are typing in the Input area and that you are in the intended Encode or Decode tab. Use Clear to reset both boxes.