String Escape / Unescape
Escape text for safe use inside a JSON string, or unescape a JSON-escaped string back to plain text.
How it works
Escaping runs your text through JSON.stringify and strips the outer quotes, turning real newlines, tabs, quotes and backslashes into the two-character escape sequences JSON uses inside a string literal. Unescaping reverses this: it wraps your input back in quotes and parses it as JSON, converting escape sequences back into literal characters and reporting an error if the sequence is malformed.
Example
Pasting text with a real line break and an embedded quote — two lines of text where the second line contains a quoted word — produces a single escaped line safe to paste into JSON or source code; Unescape reverses it back to the original multi-line text exactly.
Frequently asked questions
What counts as a valid escape sequence?
The same ones JSON uses — newline, tab, quote, backslash and Unicode escapes. Anything else after a backslash, such as an unrecognised letter, is reported as an error instead of guessed at.
Why does Escape use JSON's rules instead of another format?
JSON escaping is understood natively by JavaScript, most modern languages and config formats, making it the most broadly useful target for a single "escape" button.
Does it handle Unicode characters like emoji?
Yes — non-ASCII characters pass through unescaped by default (JSON.stringify only escapes control characters, quotes and backslashes), and round-trip correctly through Escape and Unescape.
Is my text uploaded anywhere?
No — both directions run entirely in your browser using the same JSON parser built into JavaScript.
Related tools
Format, validate and minify JSON online with clear error messages pointing at the failing line.
Regex TesterTest a regular expression against sample text and see every match, its position and captured groups.
Base64 Encoder / DecoderEncode text to Base64 or decode Base64 back to text — Unicode-safe, entirely in your browser.