About Unicode Escape Converter
Unicode escapes let you write any character using only plain ASCII, for example the check mark is \u2713. They are used in JSON, JavaScript and Java strings and in files that must stay ASCII-only, and they are what you see when an API shows Punjabi or Hindi text as a string of \u codes.
Encode keeps normal ASCII letters readable and converts every other character to a four-digit \uXXXX escape, using surrogate pairs for emoji so the output is valid in JSON and JavaScript. Decode accepts \uXXXX, the ES6 form \u{1F600} and \xNN escapes and returns the original characters.
How to use Unicode Escape Converter
- Select Encode to produce escapes or Decode to read them.
- Paste your text or the escaped string into the input box and click Run Tool.
- Copy the result into your JSON, code or configuration.
Example
Input
Namaste ਸਤਿ ਸ੍ਰੀ ਅਕਾਲ ✓
Output
Namaste \u0a38\u0a24\u0a3f \u0a38\u0a4d\u0a30\u0a40 \u0a05\u0a15\u0a3e\u0a32 \u2713
Common uses
- Making sense of an API response where Gurmukhi, Hindi or emoji text appears as \u codes.
- Storing non-English text in an ASCII-only file or legacy system.
- Checking which code points a string contains when debugging encoding problems.
Privacy and safety
This tool runs in your browser. The text you enter is processed on your device and is not sent to NHP Learning.
Frequently asked questions
Are the escapes valid in JSON?
Yes. The \uXXXX form with surrogate pairs for characters above U+FFFF is exactly what JSON.stringify() produces with escaping enabled.
Why is a single emoji two escapes?
JavaScript and JSON use UTF-16, where characters above U+FFFF are stored as two 16-bit surrogate units, so one emoji becomes two \u codes.
Does it change the characters between 32 and 126?
No. Letters, digits and standard punctuation are left as they are, so the output stays readable.