JSON Escape / Unescape
Escape strings for embedding in JSON, or unescape back to raw form. 100% local.
Escape Sequences
The JSON specification requires certain characters inside string values to be represented as two-character backslash sequences. The table below lists every mandatory and common optional sequence.
| Sequence | Character | When it appears |
|---|---|---|
| \" | Double quote | Inside a JSON string value containing " |
| \\ | Backslash | Windows paths like C:\Users\alice |
| \/ | Forward slash | Optional; most parsers accept unescaped / |
| \n | Newline | Multi-line string content |
| \r | Carriage return | Windows line endings inside strings |
| \t | Tab | Indented content inside string values |
| \uXXXX | Unicode | Any character outside safe ASCII |
When Do You Need to Escape?
You need to escape a string for JSON in these common situations:
• Embedding JSON inside another JSON string — e.g., a config value that is itself a serialized JSON document.
• Storing JSON in a database column that uses double quotes as string delimiters and does not support a native JSON type.
• Constructing JSON manually in shell scripts where " is the string delimiter and unescaped quotes would break the syntax.
Before escape:
{"message": "Hello\nWorld!"}
After escape:
{"message": "Hello\\nWorld!"}Try It
Frequently Asked Questions
Your files stay on your computer. Dad promised.