Unicode, HTML, URL and Punycode escapes
Convert text to and from \u escapes, HTML numeric entities, percent-encoding in any character set (such as GBK URLs), Quoted-Printable and Punycode domains.
Process locally
Files stay in this browser session. Closing or clearing releases them.
Add text
Type or paste the text to process
Adjust settings
Optional: Format, Direction, Characters to encode and more
Run
Processes in this browser; cancel at any time
About this tool
Convert text to and from \uXXXX Unicode escapes, HTML numeric entities, percent-encoding in any character set, Quoted-Printable as used in email, and Punycode domains. Use it to read \u4f60\u597d in a log or a JSON file, to build a GBK-encoded URL parameter, or to turn 中文.com into xn--fiq228c.com.
You can encode only non-ASCII characters, leaving letters and symbols as they are, or every character. Percent-encoding and Quoted-Printable work with UTF-8, GBK, Big5, Shift_JIS and other character sets. Up to 1 MB of text is converted in your browser without being uploaded.
How to use it
- Type or paste the text, or select Use example.
- Choose a “Format”, such as “Unicode escapes (\uXXXX)” or “Percent-encoding (URL)”, and set “Direction” to “Encode” or “Decode”.
- When encoding, choose “Non-ASCII only” or “All characters (URL: all but unreserved)” under “Characters to encode”. For percent-encoding and Quoted-Printable, also pick a “Character set”.
- Select Run, then preview the result and download it as a text file.
Formats and limits
- Input
- Text
- Output
- Plain text
- Size limit
- 1 MB
- Settings
- Format (Unicode escapes, HTML decimal entities, HTML hex entities, Percent-encoding, Quoted-Printable, Punycode domains); Direction (Encode, Decode); Characters to encode (Non-ASCII only, All characters); Character set
- Privacy
- Files stay in the current browser session. No file bytes are uploaded.
- Price
- Free, no sign-up
Common questions
Why does an emoji become two \u escapes?
Each \uXXXX is one UTF-16 code unit, and characters beyond the Basic Multilingual Plane, such as emoji, need two: U+1F600 becomes \ud83d\ude00. Decoding joins such pairs back into one character and also reads \u{1F600}, \U0001F600, %uXXXX and \xXX.
Why are spaces and & left alone by percent-encoding?
The default, “Non-ASCII only”, encodes only characters such as Chinese and leaves letters, spaces and symbols as they are. To encode a whole parameter value, choose “All characters (URL: all but unreserved)”: everything except letters, digits and - . _ ~ is encoded, and spaces become %20.
How do I decode a GBK-encoded URL?
Set “Character set” to GBK before decoding, and %C4%E3%BA%C3 becomes 你好. With the wrong character set the bytes cannot be read and you get an error. A + stays a + and is not turned into a space.
Does HTML decoding handle named entities like &?
No. This tool reads numeric entities such as 中 and 中, in either format, and leaves named entities unchanged. Use the “Encode and decode text” tool for &, < and other named entities.
How do I convert a domain with Punycode?
Enter one domain per line. Encoding turns each non-ASCII label into one starting with xn--, and decoding turns it back. Enter only the domain itself, without https:// or a path.
Related tools
Encode and decode text
Encode or decode Base64, Base64URL, URL, hexadecimal or HTML entities. Encoding is not encryption.
Base16/32/58/64/85/91 encoding
Encode or decode Base16, Base32, Base58, Base62, Base64, Ascii85, Z85 and basE91, choosing the character set of the text, or hex for raw bytes.
Character set encoding and mojibake repair
Show the bytes of text in UTF-8, GBK, GB18030, Big5, Shift_JIS and more as hex, turn hex back into text, or repair mojibake from text read in the wrong character set.
Base64 to image or file
Turn Base64 or a data: URI back into a file such as an image; the type comes from the content or the URI.
Image or file to Base64
Encode images or any other file as Base64 or as a data: URI to paste into HTML, CSS or JSON.
Byte radix and endianness converter
Convert bytes between hex, binary, octal, unsigned or signed decimal, Base64 and UTF-8 text, and swap byte order between big and little endian in 2, 4 or 8-byte words.