About this tool
Pasting multi-line text, code or Windows paths straight into a JSON file breaks it. This tool escapes quotes, backslashes, tabs, line breaks and control characters exactly the way JSON.stringify does, so the result can be dropped into a JSON document or a JavaScript string. You can leave off the surrounding quotes and escape non-ASCII characters as \u codes. It works offline in your browser.
How to use JSON Escape
- Paste the raw text.
- Choose whether to wrap it in quotes.
- Optionally escape non-ASCII characters.
- Copy the JSON string.
Frequently asked questions
Which characters get escaped?
Double quotes, backslashes and control characters such as newline and tab. Forward slashes do not need escaping in JSON.
Why escape non-ASCII?
Some older parsers and transport layers mishandle UTF-8. Pure ASCII output with \u escapes avoids that.