JSON Escape and Unescape
The JSON escape tool converts text into a form that is safe to place inside a JSON string value, escaping quotes, backslashes, newlines, tabs and control characters. The unescape direction converts an escaped string back to the characters it represents, which is useful when reading a log entry containing embedded JSON.
Your result will appear here.
Not sure where to start? Use Load example.
Results update automatically and are calculated on your device. Nothing you type is sent to a server.
Runs in your browser. Processing happens entirely in your browser. Nothing you enter is sent to Delimiter.live.
How to use the JSON Escape and Unescape
- Paste the text you want to escape, or an already-escaped string to decode.
- Choose the direction — escape for JSON, or unescape back to plain text.
- Turn the surrounding quotes off if you are pasting the result into an existing string.
- Copy the result.
Example
Line one He said "hi"
"Line one\nHe said \"hi\""
Common use cases
- Embedding a multi-line snippet inside a JSON configuration value.
- Reading an escaped JSON payload that was logged as a string field.
- Preparing text containing quotes for a JSON request body by hand.
- Decoding a stringified JSON value pulled out of a database column.
Limitations and things to watch for
- Escaping produces a JSON string, not a full JSON document. Pasting the result where a document is expected will not parse unless it is placed inside one.
- Unescaping accepts either a fully quoted string or a bare escaped body, but a fragment with unbalanced quotes will be rejected rather than guessed at.
- Escaping does not make untrusted content safe for HTML. Use the HTML entity encoder for that — JSON escaping and HTML escaping solve different problems.