Escape quotes, backslashes, newlines, tabs and control characters into valid JSON string-literal form — or unescape them back to raw text. Optional full \uXXXX Unicode encoding, auto-detect mode, and one-click minify or pretty-print. Everything runs in your browser.
No installation, no signup. Results in milliseconds.
.txt or .json file onto the input.\uXXXX.JSON string literals require these characters to be replaced with escape sequences.
| Character | Escaped form | Why it must be escaped |
|---|---|---|
Double quote " | \" | An unescaped quote ends the JSON string early and breaks parsing. |
Backslash \ | \\ | Backslash is the escape character itself, so it must be doubled. |
Forward slash / | \/ | Optional — useful when embedding JSON inside <script> tags. |
| Newline | \n | Literal line breaks are not allowed inside JSON strings. |
| Carriage return | \r | Control character; must be escaped. |
| Tab | \t | Control character; must be escaped. |
| Any non-ASCII (optional) | \uXXXX | Guarantees safe transport through ASCII-only systems. |
JSON escaping is the process of converting special characters in a string into a safe, machine-readable form so the string stays valid inside a JSON document. JSON does not allow unescaped quotes, backslashes, or control characters inside string values — leaving them raw produces invalid JSON that parsers reject.
Escaping ensures your data can be parsed correctly by applications and APIs. The most common situations where it matters:
C:\Program Files\.Escape converts special characters into escaped sequences. Unescape reverses it, turning an escaped string literal back into readable text. This tool does both — and with Auto-detect on, it picks the right direction from your input.
Every language can escape JSON in code — but an online tool is faster for quick fixes:
JSON.stringify(str)json.dumps(s)JSONObject.quote(text){
"message": "He said "Hello""
}
{
"message": "He said \"Hello\""
}
Input: C:\Users\Admin\Documents Output: C:\\Users\\Admin\\Documents
Escaping shows up across every stage of a developer workflow.
Everything developers ask about escaping and unescaping JSON.
\", backslashes become \\, and control characters are escaped: newline to \n, carriage return to \r, tab to \t, backspace to \b, form feed to \f. Forward slashes may optionally be escaped as \/, and any non-ASCII character can optionally be encoded as \uXXXX.\n, \t, \uXXXX and other sequences. Turn on Auto-detect and the tool chooses the direction based on your input.JSON.stringify), which includes escaping. In everyday use the terms are often interchangeable..txt or .json file onto the input box.Hands-on articles from our blog.
All free, all browser-based, no signup required.