All text is processed only in your browser.

JSON: a complete double-quoted string. JavaScript: string contents without outer quotes; supports \uXXXX, \u{…}, \xXX, and common escape sequences. Code is never executed.

Up to 50,000 UTF-16 code units. Text is not saved after you close the page.

How it works

Encoding produces an ASCII representation: non-ASCII characters become \uXXXX sequences, and emoji outside the BMP use a pair of surrogate escapes. JSON mode returns a complete double-quoted string. JavaScript mode returns contents without surrounding quotes and also decodes \u{1F600}, \x41, and common control escapes. No code is executed.

Practical example

Select Escape → text and JSON, then load the example: a string with Unicode escapes and a surrogate pair becomes readable text with an emoji. Use JavaScript mode for \u{1F600}. Choose the opposite direction to produce an ASCII string from multilingual text.

Local processing

Input and output are not sent to a server, included in analytics, or saved in browser storage. Copying and downloading happen only when you request them.

Frequently asked questions

Why does JSON require double quotes?

JSON mode accepts exactly one JSON string value, including its outer double quotes. Objects, arrays, and numbers are not strings. Use the JSON formatter for a complete document.

Is all JavaScript syntax supported?

No. This converts string contents; it is not a program parser. Supported escapes are \uXXXX, \u{…}, \xXX, \n, \r, \t, \b, \f, \v, \0, escaped quotes, slash, and backslash. Octal escapes, line continuations, and unknown sequences are rejected. Outer quotes in this mode are treated as text; output is not intended for insertion into template literals.

What happens to invalid Unicode?

Incomplete escapes, values above U+10FFFF, and unpaired surrogates are rejected. Error positions start at 1 and count code points; a surrogate error after decoding refers to the output position. Input is limited to 50,000 UTF-16 code units, so a long encoded result may exceed the limit for decoding it again.