JSON String Escape / Unescape
Turn any text into a safe JSON string with quotes, line breaks and unicode escaped, or turn an escaped JSON string back into plain text.
How to escape or unescape a JSON string
Paste your text
Paste or type it into the box, or press Try an example.
Choose the direction
Escape plain text into a JSON string, or unescape one back.
Copy or download
Paste the string into your JSON, or read the plain text.
Worked example
This is what JSON String Escape / Unescape gives for its own sample values. Open the tool above and change anything to try your own.
Text
He said "hi" Second line with a tab: here
- Direction
- Escape text into a JSON string
- Escape non-ASCII characters as \uXXXX
- No
- Keep the surrounding quotes
- Yes
Result
"He said \"hi\"\nSecond line with a tab:\there"
About JSON String Escape / Unescape
Turn any text, including quotes, tabs and line breaks, into a safe JSON string, or turn an escaped string back into readable text. It is the quick way to embed a snippet or a log line inside a JSON field.
FAQs
What gets escaped?
Quotes, backslashes, line breaks, tabs and other control characters. You can also escape non-ASCII characters as \uXXXX.
Can I drop the surrounding quotes?
Yes. Turn the option off to get only the inside of the string.
Is it the same as URL encoding?
No. Use URL Encoder / Decoder for that.