JSON Escape and Unescape — Encode or Decode a JSON String

Escape quotes, backslashes and newlines into a JSON string, or unescape a quoted JSON string back into text. All processing stays local.

JSON Escape / UnescapeLocal processing · No upload · 20 MiB per input

How to use JSON Escape / Unescape

Choose Escape to encode any text as a quoted JSON string. Choose Unescape to decode a JSON string with enclosing double quotes. Copy or download the converted text.

JSON Escape / Unescape rules and limits

Escape accepts arbitrary text and includes enclosing quotes in its output. Unescape requires a valid JSON string, not an object or array. Decoded text does not have to be a valid JSON document. This is JSON string escaping, not HTML or URL encoding.

Each input is limited to 20 MiB of UTF-8 text and 128 nesting levels. Processing runs in your browser with a 30-second timeout and no cloud fallback. A recent browser with Web Workers is required. Files and pasted text are never uploaded or saved to browser storage.

Example

Text: hello "Ada" → JSON string: "hello \"Ada\""

JSON Escape / Unescape FAQ

Should I include the enclosing quotes for unescape?

Yes. Supply a complete JSON string, including its enclosing double quotes. An object or an unquoted string is rejected.

Can I decode JSON embedded in a log string?

Yes, if it is encoded as a valid JSON string. Unescape it, then open the decoded result in JSON Viewer or Formatter using the related tool links.

Does this escape HTML characters?

No. This page handles JSON strings. HTML escaping and URL encoding use different rules.