String Tool
JSON Escape / Unescape
Escape special characters in a plain text string so it can be safely embedded inside a JSON value. Or unescape a JSON-encoded string back to its original readable form. All processing happens locally in your browser.
Input
Paste plain text to escape, or a JSON-escaped string to unescape
Output
JSON Escape Characters Reference
| Character | Escaped | Description |
|---|---|---|
| " | \" | Double quote — must be escaped inside JSON strings |
| \ | \\ | Backslash — must be escaped to avoid ambiguity |
| newline | \n | Line feed / new line character |
| tab | \t | Horizontal tab character |
| carriage return | \r | Carriage return character |
| / | \/ | Forward slash (optional but valid) |
| backspace | \b | Backspace character |
| form feed | \f | Form feed character |
When Do You Need to Escape JSON?
- Embedding a JSON string inside another JSON string value
- Storing JSON in a database field as a string
- Passing JSON as a query parameter in a URL
- Including JSON inside HTML attributes or JavaScript string literals
- Sending JSON in email bodies or log files where special characters cause issues
Escape vs Encode — What's the Difference?
JSON escaping adds backslash sequences for special characters within a string value. It is different from URL encoding (which uses % sequences) and Base64 encoding (which converts binary to ASCII). Use JSON escaping when you need to embed a string safely inside a JSON document. Use URL encoding for query parameters, and Base64 for binary data.
Need to validate the full JSON?
Open JSON Validator →
Use the JSON validator to check the complete document.