Skip to content
TextArray
100% local

JSON string escape and unescape

Escape raw text into a JSON string or parse JSON escapes back to readable text.

Input
Output

JSON string escape and unescape

Every string embedded in a JSON document has to follow the format's escaping rules: double quotes and backslashes get a leading backslash, line breaks become \n, tabs become \t, and control characters below U+0020 are written as \uXXXX sequences. This tool converts raw text into that escaped form and back. Paste a multi-line log message, an SQL query or a snippet of HTML, and the output drops straight into a JSON payload, a config file or a curl body without breaking the parser.

Two options shape the escaped output. "Wrap in quotes" surrounds the result with double quotes, producing a complete JSON string literal ready to paste after a colon; switch it off when the destination already provides the quotes. "Escape non-ASCII" additionally rewrites every character above U+007F as a \uXXXX sequence — accented letters become single escapes and emoji become surrogate pairs like \ud83d\ude00 — keeping the output pure ASCII for legacy systems, HTTP headers or tooling that mangles UTF-8.

Unescape does the reverse: it parses JSON string escapes, including \uXXXX sequences and surrogate pairs, back into readable text. It accepts input with or without the surrounding quotes, so a value copied straight out of a JSON file works as-is. Invalid input — an unmatched backslash or a stray quote — produces a clear error instead of a half-converted result.

Everything runs locally in your browser: nothing is uploaded and your text never leaves your device. The tally under the output counts characters before and after conversion plus the number of escape sequences applied, updating live as you type.

FAQ

Which characters get escaped?
Double quotes, backslashes and every control character below U+0020. Line breaks, tabs, backspace, form feed and carriage return use their short forms (\n, \t, \b, \f, \r); other control characters become \uXXXX sequences.
What happens to emoji and accented letters?
By default they pass through untouched — JSON allows any UTF-8 character inside a string. Turn on "Escape non-ASCII" to rewrite them as \uXXXX sequences; emoji become surrogate pairs like \ud83d\ude00.
Does unescape need the surrounding quotes?
No. It accepts a complete JSON string literal with quotes or just the escaped body without them, so values copied straight out of a JSON file work either way.
When should I switch off "Wrap in quotes"?
When the destination already provides the quotes — a template, a generated file or a string builder. With the option off you get only the escaped body.
Is my text uploaded anywhere?
No. The tool runs entirely in your browser and your text never leaves your device.