Skip to content
OddsockLocal
Local
Source text
{
  "color": "red",
  "count": 2
}
1 wordsRuns in this browser. Nothing is uploaded.

How to use

  1. Paste a JSON string literal into Source text, starting and ending with a double quote.
  2. Include the backslash escapes. Do not paste a raw object.
  3. Read the decoded text.
  4. If that text is JSON, paste it into the formatter or the validator to parse it as a document.

What is JSON unescape?

JSON unescape is the reverse of JSON escape. The paste has to be a JSON string literal: a quote, the contents, and a closing quote, with escapes written the way JSON writes them. The page parses that literal and returns the characters inside. Newlines stored as \n become real line breaks. \" becomes a quote.

Read more

Pasting {"color":"red","count":2} without the wrapping quotes fails with Expected a JSON string literal, because that text parses as an object. Paste the escaped result instead, quotes included, and the characters of the compact object come back. The page returns text, not a re-parsed document. If the inside happens to be JSON, it is still text until you pass it to the formatter or the validator.

Use cases

  • A fixture field holds an escaped payload and a developer wants the JSON text back.
  • A log line stored a message as a JSON string and the escapes need to be real characters.
  • Escape the color object, then paste the literal here and confirm the compact characters return.
  • Someone debugging a double-encoded body peels one string layer off.
  • A config value wrapped in quotes, with \n between lines, is expanded into the multi-line note.

The escaped color object, unwrapped

Paste the literal produced by JSON escape, including the quotes: "{\"color\":\"red\",\"count\":2}"

{"color":"red","count":2} Pasting the object without those outer quotes returns Expected a JSON string literal.

Why use Oddsock

One string layer comes off, which is the step you need when a payload was stored inside a JSON string and you want the text it held.

Related tools

Using this tool

The object parses as an object. This page accepts only a string. The sample error is Expected a JSON string literal. Wrap it with JSON escape first, or add the quotes and escapes yourself.