To escape a JSON string, paste your raw text into the tool and choose Escape; quotes, backslashes and line breaks become escape sequences safe to put inside a JSON string. Choose Unescape to turn an escaped string back into plain text.
Follow along with the free JSON Escape/Unescape, which runs in your browser, or browse more tools in this category.
How to use the JSON Escape/Unescape
- Paste the raw text or the escaped string.
- Choose Escape or Unescape.
- Read the result.
- Copy it into your JSON or code.
Worked example
The text He said “hi” and a new line becomes He said “hi”n when escaped, with the quotes backslashed and the line break shown as n.
Tips and common mistakes
- Escape text before placing it inside a JSON string value, or the JSON will break.
- Use Unescape to read logs where JSON strings appear with many backslashes.
- Double-escaped strings need to be unescaped twice.
Frequently asked questions
Why do I see so many backslashes?
Each backslash marks a special character such as a quote or line break inside a JSON string.
What characters get escaped?
Double quotes, backslashes and control characters such as new lines and tabs.
Is it private?
Yes. It runs in your browser.