JSON String Escape
Escape quotes, backslashes, tabs and line breaks so any text can be embedded inside a JSON string. Free online JSON string escaper.
Runs in your browser. Nothing is uploaded.
About JSON String Escape
To put arbitrary text inside a JSON string, quotes, backslashes and control characters such as line breaks must be escaped (" becomes \" and a new line becomes \n). This tool does exactly what JSON.stringify does to a string, minus the surrounding quotes.
Use it when hand-writing JSON config, test fixtures or API request bodies that contain multi-line text.
How to use JSON String Escape
- Type or paste your text into the input box. Press Sample to see an example.
- The result appears instantly as you type.
- Copy the result, or press Use as input to chain another transformation.
Frequently asked questions
How do I reverse it?
Use JSON String Unescape.
Are non-English characters escaped?
No. JSON allows any Unicode character in strings, so only characters that must be escaped are.
Is JSON String Escape free and private?
Yes. JSON String Escape is completely free with no sign-up. Everything runs in your browser, so whatever you type or paste never leaves your device.