🔒 100% private — runs in your browser, nothing is uploaded

JSON Unescape (and Escape)

Unescape a JSON string back to readable text — or escape plain text into a valid JSON string — with strict RFC 8259 validation and a round-trip check.

Escaped JSON is what you get whenever JSON travels inside something else: a payload nested in another JSON field, a log line wrapping a request, a config value holding a document. Unescaping is the exact inverse of the string rules in RFC 8259 — \" becomes a quote, \n a line break, \u0041 the letter A — and this page performs it by parsing, not by search-and-replace, which is why it can be strict: an input containing an escape JSON does not define (\x, \’), a trailing lone backslash, or a literal newline inside the string is rejected with the parser’s reason, where a regex-based tool would hand you corrupted text and no warning. Worked example: the escaped string “He said \"hello\"\nand left.” unescapes to two lines — He said "hello" — and left. — and escaping that text returns the original string exactly, which the page verifies on every Escape with a round-trip check.

The text you paste — which is often a log line or a payload containing real data — is processed in page memory on your device only: it is never uploaded, never stored and never put into a link. Unescape validates strictly against the JSON specification (RFC 8259): an invalid escape or a raw control character produces a readable error here, not a silently wrong result. For formatting, validating and exploring whole JSON documents, use the JSON Formatter at /json/ — this page is its string-level companion.

Quick answers

How do I unescape a JSON string?

Paste the escaped string — with or without its surrounding double quotes — and press Unescape. The page parses it under the JSON rules (RFC 8259), so \n becomes a real line break, \" a quote and \uXXXX the character it encodes, and invalid escapes are reported with a reason instead of being silently mangled.

If the value was escaped more than once, the page says how many layers it found; one press removes one layer.

Which characters must be escaped in a JSON string?

Exactly three groups, per RFC 8259: the double quote, the backslash, and the control characters U+0000 to U+001F (which include newline, tab and carriage return, written \n, \t, \r). The Escape direction on this page escapes exactly those by default; escaping slashes or non-ASCII characters is optional and offered as checkboxes.

Everything else — including accented letters and emoji — is legal unescaped in a JSON string, which is why the default output stays readable.

How to use

  1. Paste your text. For Unescape it may be a full JSON string literal in double quotes, or the escaped contents without them — both forms are accepted.
  2. Press Unescape to decode, or Escape to encode plain text into a JSON string. Escape options: wrap the result in quotes, also escape forward slashes, or escape every non-ASCII character as \uXXXX.
  3. Read the verdict line: a successful unescape reports the decoded length and, if your input was escaped more than once, how many layers were detected. An invalid input reports why — a lone backslash, an escape JSON does not define, or a raw line break — instead of producing a silently wrong result.
  4. To peel a second layer, press “Use output as input” and unescape again. One Unescape always removes exactly one layer, so you stay in control of nested payloads.

About this tool

The double-escaping case gets its own handling, because it is the one that wastes afternoons: when a value has been escaped twice, one unescape leaves you holding a string that still looks escaped. This page detects the extra layers and tells you how many there are, while still removing only one layer per press — peeling is deliberate, never a surprise. Neighbours, kept separate on purpose: the JSON Formatter at /json/ validates, pretty-prints and explores whole JSON documents; this page works one level down, on a single string value, and the two link to each other. The JSON Schema Generator is a third different job — inferring a schema from a document — despite the similar names.

How it works

Escape mapping (RFC 8259): " → \", \ → \\, newline → \n, carriage return → \r, tab → \t, backspace → \b, form feed → \f, any other control character below U+0020 → \u00XX. Forward slash and non-ASCII escaping are optional and off by default, matching what JSON.stringify produces.

Unescape is defined as parsing: the input (wrapped in quotes if it does not already carry them) is parsed as a JSON string literal, and any parse failure is reported rather than repaired. Round-trip property the page checks on Escape: unescape(escape(x)) = x, exactly.

What this tool can’t do

Strict means strict: inputs that lenient tools accept — single-quoted strings, trailing commas in embedded documents, \x escapes from other languages — are rejected here with the parser’s reason, because silently “fixing” them changes data.

This page works on one string value. A whole escaped document (a JSON text that is itself inside a string) unescapes to a JSON text — to explore or validate that document, take the result to the JSON Formatter.

Surrogate pairs in \u escapes are handled exactly as JSON.parse handles them: a valid pair decodes to its character; a lone surrogate is preserved as-is rather than replaced, so no information is invented or destroyed.

Worked examples

Log line payload: “{\"user\": \"ada\", \"ok\": true}” unescapes to the readable document {"user": "ada", "ok": true} — ready to paste into the JSON Formatter.

Double-escaped quote: A value holding \\"hello\\" was escaped twice. The verdict reports 2 layers; the first Unescape yields \"hello\", and “Use output as input” plus a second Unescape yields "hello".

Invalid escape caught: A Windows path typed with single backslashes — C:\xampp\path as it would appear in a config file — is not valid escaped JSON: \x is not one of the escapes JSON defines, and the error line says so, instead of returning quietly corrupted text.

JSON string escapes (RFC 8259)

EscapeMeaningRequired?
\"Double quoteYes
\\BackslashYes
\n, \r, \tLine feed, carriage return, tabYes (control characters)
\b, \fBackspace, form feedYes (control characters)
\uXXXXAny other control character below U+0020Yes for those characters
\/Forward slashOptional — offered as a checkbox

Frequently asked questions

Why did my input fail to unescape?

Almost always one of three causes, and the error line names the family: a lone backslash that is not part of a valid escape; an escape JSON does not define — JSON allows only \", \\, \/, \b, \f, \n, \r, \t and \uXXXX, so \x and \’ are invalid; or a real line break inside the string, which must be written as \n. Fix the cause, or escape the raw text first if what you hold was never escaped JSON.

Do I need the surrounding double quotes?

No. Paste the escaped contents with or without their surrounding quotes. If the trimmed input both starts and ends with a double quote it is parsed as the literal it appears to be; otherwise the page wraps your input in quotes before parsing. Either way the result is the decoded text itself, without quotes.

What does “escaped twice” mean?

The value went through an escaper two times — common when a payload is embedded, logged, and embedded again. Each layer shows as extra backslashes: a quote appears as \\" instead of \". One Unescape removes exactly one layer; the page counts the layers for you and the “Use output as input” button sets up the next peel.

Is it safe to paste payloads with tokens or personal data?

The conversion runs entirely in this page on your device: nothing you paste is uploaded, stored or put into a link, and refreshing clears both boxes. That is the right default for log lines and API payloads — but it is still your data on your screen, so normal care applies.

📦 Embed this tool on your site

<iframe src="https://verystep.com/embed/json-unescape/" title="JSON Unescape (and Escape)" width="100%" height="520" loading="lazy" style="border:0"></iframe>

Free to use. The embed shows a small "Powered by Verystep" link.

First time embedding? Read the step-by-step guide →

More free tools