We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Was this tool helpful to use?
Your feedback helps us make it better
A tool for bidirectional conversion between text and Unicode escape sequences (such as \uXXXX format).
Overview
Understand what the tool solves, how it works, and the boundaries of its data.
This converter changes text into literal \uXXXX sequences or changes matching escapes back into characters. In encode mode, non-ASCII characters are escaped by default; “encode all” also escapes ASCII. For example, “café” becomes caf\u00e9 by default. In decode mode, a backslash-u followed by exactly four hexadecimal digits is replaced with the corresponding UTF-16 code unit.
The four digits describe a 16-bit code unit, not a UTF-8 byte sequence. A supplementary character uses two UTF-16 code units and therefore appears as two consecutive escapes. UTF-8 represents characters as bytes using a separate encoding form. Changing the written representation does not encrypt, hash, or protect the text.
Guide
Follow the workflow and verify inputs and outputs with practical examples.
Select text-to-escape encoding or escape-to-text decoding. The result appears in the output area for review and copying.
For encoding, enter ordinary text. Leave “encode all” off to preserve ASCII, or turn it on to escape ASCII too. For decoding, include the literal backslash sequences such as \u0041.
Check that the output matches the target representation. To check a round trip, encode a sample and then decode the resulting string.
| Input | Mode | Output |
|---|---|---|
| café | Encode, default | caf\u00e9 |
| café | Encode all | \u0063\u0061\u0066\u00e9 |
\u0041 | Decode | A |
Use cases
See how the tool fits into real work and everyday tasks.
Developers can make non-ASCII characters visible in a sample when checking how a file or configuration represents escaped text. Confirm the consuming language's syntax before using the result in source code.
A learner can compare a visible character with its four-digit escape, then see that supplementary characters use a pair of UTF-16 escapes. This illustrates the difference between code units and UTF-8 bytes.
Q&A
Find concise answers to common questions and confusing cases.
No. The output uses four-hex-digit UTF-16 code-unit escapes. UTF-8 encoding produces bytes and uses a different representation.
Supplementary Unicode characters use a pair of 16-bit surrogate code units in UTF-16, so each code unit is written as its own \uXXXX sequence.
No repair is performed. Decoding replaces only a backslash-u followed by four hexadecimal digits. Other text remains as entered; review and correct malformed input yourself.
Notes
Review scope, result limitations, and important precautions before use.
This is a text escape converter, not a general Unicode normalizer or validator. It does not convert to UTF-8 bytes, percent-encode text for URLs, interpret every programming language's escape syntax, or encrypt data. A four-digit escape corresponds to one UTF-16 code unit; paired surrogates may represent one supplementary character. Decoding uses a simple pattern match, so isolated surrogate escapes or language-specific escape rules may not produce the character you expect. Verify output in the target format before using it in code or data interchange.
Related
Discover related tools, collections, and available API capabilities.