JSON Escape / Unescape
Escape text containing quotes, newlines and backslashes into a form safe to embed in JSON, or restore it — handy when writing fixtures and string literals.
>_ USAGE GUIDE
Turn text containing quotes, newlines, backslashes, and tabs into an escaped string that is safe to embed in JSON — \ becomes \\, " becomes \", newline becomes \n, carriage return \r, tab \t. The reverse direction restores an escaped string back into readable text with one click.
Escaping and unescaping work independently in separate panels, so you can switch back and forth while debugging. It saves you from hand-writing backslash soup when writing test fixtures, building string literals in code, or safely placing user input into a JSON field.
- Escape: paste text with quotes, newlines, or backslashes and get a JSON-safe escaped string to copy into configs or code
- Unescape: paste an escaped snippet full of
\nand\"from logs or APIs and restore it to readable form - Round-trip: escape and then unescape to confirm nothing is lost
All processing happens locally in your browser with zero uploads, so text containing sensitive fields is safe to handle.
>_ FAQ
Q1 · What exactly does JSON escaping do?
In JSON, double quotes delimit strings and backslash is the escape character, so a literal " or \ inside a string must be written as \" and \\. Control characters such as newline, carriage return, and tab must also be written as \n, \r, and \t. Escaping rewrites such characters in the allowed form so the text can exist as a valid JSON string value.
Q2 · Is JSON escaping encryption? Is it secure?
No. Escaping is just an encoding that lets special characters appear legally inside a JSON string — there is no key and nothing is truly hidden. It guarantees syntactic correctness, not confidentiality. For secrecy, use real encryption; escaping is for getting quotes, newlines, and backslashes safely into JSON without breaking its structure.
Q3 · Can unescape handle \n and \t from logs?
Yes. Escape sequences like \n, \t, \", and \\ that commonly appear in API logs and config files are converted back into real newlines, tabs, quotes, and backslashes, turning hard-to-read escaped text into readable content while debugging.
Q4 · Will escaping change my Chinese characters?
No. JSON escaping normally handles only characters that need special representation (quotes, backslashes, control characters); ordinary text such as CJK stays as-is. If your goal is rewriting Chinese or Emoji as \uXXXX, that is Unicode escaping, which differs from structural escaping and is covered by a separate tool.
Q5 · When would I actually use JSON escaping?
Writing test fixtures that contain quotes or newlines, assembling JSON string literals in code, safely dropping user- or system-supplied text into a JSON field, and explaining escaped content returned by an API. Adding those backslashes by hand is error-prone — a one-click escape is far more reliable.