JSON Escape
Escape and unescape JSON strings.
About the JSON Escape
Escapes a block of text so it can sit inside a JSON string, and reverses the process. Quotes become \", backslashes are doubled, and newlines, tabs, and control characters become \n, \t, and \uXXXX. Reach for it when you need to embed a certificate, a SQL statement, or a log excerpt into a config file or a request body without breaking the surrounding document.
How to use the JSON Escape
- Paste the text into the input panel, or press Sample to load an example.
- Press Escape to get the escaped form, or Unescape to turn an escaped value back into plain text.
- Copy the result, or Download it as escaped.txt.
Frequently asked questions
- Does the output include the surrounding quotes?
- No. You get the escaped body on its own, ready to paste between quotes that already exist in your JSON.
- Why does Unescape fail on my string?
- The input has to be a valid JSON string body. A double quote that was never escaped will break it, and so will copying the opening and closing quotes along with the value.
- Are accents and emoji escaped?
- No, they are left as they are, because JSON is UTF-8 and those characters are legal inside a string. Only control characters below U+0020 are written out as \uXXXX.
- Is this the same as escaping for another language?
- Close, but not identical. The String Escape tool covers the C-style rules shared by Java, C#, Go, and C, which differ from JSON in which escape sequences are recognised.
- Is my text uploaded?
- No. Escaping is a JSON.stringify call running in your browser tab, so tokens and credentials inside a payload stay on your machine.