JSON string escape and unescape
Escape raw text into a JSON string or parse JSON escapes back to readable text.
Related tools
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.