Escape and unescape JSON strings
Runs locallyTurn text into an escaped JSON string literal, or read one back.
Raw text
Escaped
{\"name\":\"Ada\",\"quote\":\"She said \\\"hello\\\"\",\"path\":\"C:\\\\temp\"}About escaping JSON strings
How it works in 4 steps · 4 common use cases · 3 questions answered
About escaping JSON strings
How it works in 4 steps · 4 common use cases · 3 questions answered
How it works
- 1.Paste raw text to escape it into the form that is legal inside a JSON string.
- 2.Quotes, backslashes, newlines, tabs and control characters are all handled.
- 3.Or paste an already-escaped string to unescape it back into readable text.
- 4.Copy whichever direction you needed.
Common use cases
- •Embedding a block of JSON inside another JSON string field
- •Reading an escaped payload copied out of a log line
- •Putting a multi-line certificate or key body into a single JSON string
- •Fixing a request body that a tool has double-escaped
FAQ
Does the escaped output include the surrounding quotes?
The escaping covers the string contents. Add the quotes when you paste it into place, or the pair will be escaped as part of the text.
How are non-ASCII characters treated?
They are left as themselves, which is valid JSON in UTF-8 and stays readable. Escaping to \u sequences is only needed for transports that cannot carry UTF-8.
Why does my string look double-escaped?
Usually because it was escaped twice on the way in — once by the producing code and once by the transport. Run unescape twice and check whether the second pass gives readable text.