Shard Tools

JSON Unescape and Escape

Escape or decode a JSON string without sending API payloads, logs, or configuration data to a server.

Maintained by Roshan.

Browser-local JSON string utility

Use JSON Unescape and Escape

Escape produces string content without surrounding quotes. Unescape accepts that fragment or a complete quoted JSON string.

Operation

Automated release checks round-trip quotes, backslashes, line breaks, tabs and Unicode text through escape and unescape. Invalid sequences such as backslash-q are rejected instead of silently changed.

Explore developer and data tools

Find related browser-local tools for nearby tasks without starting another search.

Browse all developer and data tools

About JSON Unescape and Escape

JSON Unescape removes one valid JSON string layer from text copied out of a log, API response, environment variable, or database field. JSON Escape performs the reverse operation when ordinary text or a complete object must travel inside another JSON string. Both operations follow the JSON grammar rather than deleting every backslash blindly: quotation marks, line breaks, tabs, Unicode escapes, and literal backslashes retain their intended meaning, while malformed input is rejected instead of guessed at. The result reports how many escape sequences were processed, the input and output lengths, and whether an unescaped value is itself valid JSON. All parsing and serialization happen in the current browser tab, so private payloads do not need to reach a remote utility service.

Work through the input

  1. Choose Escape when you have ordinary text or a JSON document that must be placed inside a JSON string. Paste the source exactly as it should read after decoding. The result omits the surrounding quotation marks, making it suitable for insertion between the quotes of an existing property. Quotes become backslash-quote, backslashes are doubled, and control characters such as a line break or tab receive their standard JSON representation.
  2. Choose Unescape when the input already contains JSON escape sequences. You may paste a complete string literal, including its outer quotation marks, or paste only the escaped content. The tool uses strict JSON parsing in both cases. An unknown sequence such as backslash-q, an incomplete Unicode escape, an unescaped quotation mark, or a literal line break inside a quoted string is rejected with the parser's reason.
  3. Inspect the decoded-value label after unescaping. Valid JSON means the resulting text can itself be parsed as a JSON value, which commonly happens when an object was embedded as a string. Plain text is not an error; it simply means the decoded result is a message, path, regular expression, or other string rather than a complete JSON document.
  4. Copy keeps the exact output on the clipboard, while Download TXT creates the result locally as a text file. Character counts use JavaScript string length, so characters outside the basic multilingual plane may occupy two UTF-16 code units even though a reader sees one symbol.

When json unescape and escape is useful

One encoded object: input and output

Paste {"name":"Mira"} into Escape: the output is {\"name\":\"Mira\"}. Paste that escaped output into Unescape: the result is {"name":"Mira"}, labelled Valid JSON. Compare the name and punctuation before copying it into your application.

A literal backslash is data

Unescape the complete JSON string literal "C:\\Temp" and the result is C:\Temp. The remaining backslash belongs to the path. Deleting it would change the value to C:Temp. A Plain text label is expected for a path; it does not mean decoding failed.

Two layers need two deliberate checks

Unescape the complete literal "\"hello\"": the first result is "hello", including its quotes. A second pass produces hello without quotes. Stop after the first pass if your application expects a JSON string literal; continue only if it expects the underlying text.

Embedding an object in an API field

A service expects a property whose value is a string containing another JSON document. Escape converts the inner object's quotation marks and backslashes while preserving its braces and data, so the result can be inserted into the outer property's quoted value.

Reading an escaped log message

A log viewer shows a payload with backslash-quote around every property and backslash-n between lines. Unescape removes that one string layer and marks the decoded result as Valid JSON, ready to paste into JSON Formatter or JSON Diff.

Removing backslashes without damaging the object

An escaped fragment representing a name and an active flag becomes an ordinary JSON object after one Unescape pass. Quotes become readable again, while intentional backslashes inside paths remain correctly represented instead of being stripped indiscriminately.

Rejecting a damaged Unicode sequence

An export contains an incomplete sequence such as backslash-u12. The tool reports that it cannot decode the string rather than deleting the slash or manufacturing a replacement character, preserving evidence that the source data is damaged.

Check the output

Questions about JSON Unescape and Escape

What should I do when unescaping fails?

Check that you copied the whole value, including any closing quote, and that the source is a JSON string rather than JavaScript source, HTML, or a URL. A complete object such as {"name":"Mira"} is already decoded; use JSON Formatter for it. Return to the original export when a sequence is truncated instead of deleting backslashes until the error disappears.

What characters does JSON Escape change?

It escapes double quotes, backslashes, and JSON control characters such as newline, carriage return, tab, backspace, and form feed. Printable Unicode text normally remains readable because JSON supports Unicode directly.

Why does JSON Unescape reject my backslash sequence?

JSON recognizes only a small set of escapes: quotation mark, backslash, slash, b, f, n, r, t, and a four-digit hexadecimal Unicode sequence after u. Other sequences may belong to a programming language or regular-expression syntax, but they are not valid JSON string escapes.

Does unescaping parse the decoded object?

It checks whether the decoded text is valid JSON and reports the result, but it returns the original decoded text rather than reformatting or changing the object. Use JSON Formatter when you want structured indentation or minification afterward.

Can I remove backslashes from JSON by replacing every slash?

No. Some backslashes encode quotes or line breaks, while others may be part of a path or another literal value. Unescape parses one valid JSON string layer so meaningful characters are decoded under JSON rules rather than removed blindly.

Is sensitive JSON uploaded while escaping it?

No. The native JSON string parser and serializer run in browser memory, the page declares no API endpoint, and the result is copied or downloaded directly from the tab.

Related tools

JSON Formatter and Validator

Format, minify, and validate JSON locally in your browser. Inspect keys, values, nesting depth, and root type without sending private API data to a server.

JSON Validator

JSON Validator in your browser. Instant, accurate, and nothing is uploaded.

JSON Diff

Compare two JSON documents by structure and value. Find added, removed, changed, and type-changed paths locally in your browser.

Unicode Escape

Convert text into Unicode escape sequences in your browser, handling characters above the basic plane.

Unicode Unescape

Convert Unicode escape sequences back into readable characters in your browser.

URL Encoder and Decoder

Percent-encode and decode URLs in your browser, choosing between encoding a value inside a URL and encoding a whole address. Shows which characters differ.