JSON Escape Tool
Escape any text so it can sit inside a JSON string value. Quotes, backslashes, newlines and control characters are converted to JSON escape sequences. Everything runs locally in your browser; nothing is uploaded.
Paste text on the left. The right side shows the same text with every character that JSON requires escaped, ready to paste between the quotes of a JSON string.
Text to escape
Escaped JSON string body
Output appears here.Learn more
Why JSON needs escaping
A JSON string is delimited by double quotes, so a raw quote inside the value would end the string early. Raw newlines are also forbidden. Escaping replaces them with backslash sequences the parser understands.
Nested JSON
To embed one JSON document inside another as a string, escape it first. Without this, the inner quotes break the outer document.
Frequently asked questions
Which characters are escaped?
Double quotes, backslashes and control characters such as newline, tab and carriage return. Other characters stay as they are.
Do I include the surrounding quotes?
The output is the string body only. Wrap it in double quotes when you paste it into JSON.
How do I reverse it?
Use the JSON Unescape tool.