Escape raw text into JSON string content — or unescape a JSON string back to readable text. Handles quotes, backslashes, newlines, tabs, control characters and \u escapes.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
Two directions, one tool
Escape takes raw text — quotes, Windows paths, multi-line strings — and produces content safe to place inside a JSON string value. Unescape reverses it: paste a JSON string (with or without its surrounding quotes) and get the readable original back. The Swap button flips input and output and the direction, so bouncing between the two is one click.
Worked example
Raw text:
He said: "Reports\Q3 are ready."
Path: C:\Users\meeraEscaped for JSON:
"He said: \"Reports\\Q3 are ready.\"\nPath: C:\\Users\\meera"Every double quote became \", every backslash \\, and the line break \n — exactly what RFC 8259 requires inside a JSON string.
When to use it
- Embedding one JSON document inside another as a string field (webhook payloads love this).
- Putting multi-line text, file paths or code snippets into config values.
- Decoding stringified JSON found in logs back into something readable.
- Preparing string literals for curl commands and API test fixtures.
Limitations to know
- Non-ASCII text — é, हिन्दी, emoji — passes through unescaped, which is correct: JSON is UTF-8 and only quotes, backslashes and control characters need escaping.
- Unescape removes exactly one level. Double-escaped strings (full of
\\n) need two passes. - This escapes string content; it does not validate whole documents. For that, the cluster’s validator tools apply.
Common errors and fixes
- “This is not a valid escaped JSON string” — most often a lone backslash (should be
\\) or a bare quote (should be\"); the message points near the offending character. - Output has quotes around it that I don’t want — untick “wrap escaped output in double quotes” when inserting into an already-quoted string in code.
- The input parsed as JSON, but not as a string — you pasted an object or number into unescape mode; paste only the string value itself.
How to use the JSON String Escape / Unescape
- Paste raw text to escape — or an escaped JSON string to decode.
- Pick the direction: Escape (text → JSON string) or Unescape (JSON string → text).
- Click "Convert".
- Copy the result — or hit "Swap input ↔ output", which also flips the direction, to go straight back.
Frequently asked questions
When do I need to escape a string for JSON?
Whenever text becomes the content of a JSON string value: quotes inside it, backslashes (Windows paths!), newlines and tabs would otherwise break the JSON. Typical cases are embedding JSON inside JSON, log payloads and config values.
Which characters get escaped?
Double quotes become \", backslashes become \\, and control characters become \n, \r, \t, \b, \f or \uXXXX. Non-ASCII text like é or emoji needs no escaping — JSON is UTF-8 per RFC 8259 — so it passes through readable and unchanged.
How do I fix a double-escaped string?
A string escaped twice (full of \\n and \\") needs two passes: run Unescape once to remove one layer, then run it again on the result. Each pass removes exactly one level of escaping.
Should the escaped output include the surrounding quotes?
Include them when pasting the whole value into a JSON document; exclude them (untick the option) when inserting into an existing quoted string in code.