About this tool
Embedding text in JSON means escaping quotes, backslashes and line breaks correctly. Escape turns any text into a valid JSON string, ready to paste into a payload. Unescape does the reverse, which helps when reading strings nested inside logs or API responses.
How to use it
- Choose Escape or Unescape.
- Paste your text.
- Copy the result, with or without surrounding quotes.
Example
He said "hi" C:\temp
"He said \"hi\"\nC:\\temp"
Questions
- Which characters get escaped?
- Double quotes, backslashes and control characters such as newlines and tabs. Other Unicode characters are valid in JSON strings and stay as they are.
- Does unescape need the surrounding quotes?
- No. It accepts both "line\nbreak" and line\nbreak. Unescaped double quotes inside the text are reported as an error.
- Can I unescape a string that holds JSON?
- Yes. Unescaping gives you the inner JSON as text, which you can then paste into the JSON Formatter.