JavaScript escape / unescape
Convert text with the classic JavaScript escape()/unescape() rules: A-Za-z0-9 @ * _ + - . / stay, code units below 256 become %XX, everything else becomes %uXXXX. Decoding accepts either hex case and surrogate pairs and fails loudly on malformed input.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Encoding keeps A-Za-z0-9 @ * _ + - . /, writes code units below 256 as %XX and everything else as %uXXXX — exactly like JavaScript escape().
Result
Converted locally. Decoding fails loudly on an incomplete % sequence instead of dropping characters.
Enter text to convert
Output chars: 0 · Input chars: 0 · Sequences: 0
What this tool does
- Turn Chinese or other non-ASCII text into %uXXXX so it survives ASCII-only systems and config files
- Decode %XX / %uXXXX escape sequences pasted from logs, URLs or legacy scripts
Example
Input
你好 world
Output
%u4F60%u597D%20world
Each Chinese character is one UTF-16 code unit, so 你好 becomes %u4F60%u597D, the space becomes %20, and letters are left untouched.
Frequently asked questions
How is this different from URL encoding?
The reserved set and the encoding unit differ: escape keeps @ * _ + - . / and writes Chinese as %uXXXX, while encodeURIComponent percent-encodes UTF-8 bytes (%E4%BD%A0 style) and does not decode %uXXXX. Use the URL encoder for query strings; this tool reproduces JavaScript escape()/unescape().
Why is é %E9 while Chinese is %u4F60?
escape works on UTF-16 code units: below 256 it writes two hex digits (%XX), otherwise four (%uXXXX). Latin-1 characters therefore become %XX and Chinese, Japanese or emoji become %uXXXX, with surrogate pairs split into two sequences (😀 = %uD83D%uDE00).
What happens when decoding fails?
An incomplete or invalid sequence — a lone %, %ZZ, %u12, %uGGGG — raises a clear error instead of silently dropping or passing characters through, so you never get output that looks fine but is misaligned.
Is the text uploaded?
No. Encoding and decoding are local pure functions with no network requests and nothing written to storage.
Keywords:js escape%uXXXXJavaScript escapeescape