Friday, November 6, 2026 · Asia/KarachiFree tools · No signup · Runs in your browser

String to JSON

String to JSON is for the moment a value has been wrapped in quotes and its inner quotes have been escaped, so you are looking at a string that contains JSON rather than at the JSON itself. This page parses once. If the result is a string, it parses that string again and pretty-prints the value inside.

New

If the first parse is already an object or an array, the page says so and pretty-prints that value. It does not pretend to have unwrapped anything.

How to use

  1. Paste either a quoted JSON string or a JSON value.
  2. Press Unwrap and read the status line.
  3. Reset restores a quoted object whose inner quotes are escaped.

Formula / how it works

Two parses, on purpose. JSON.parse on "{\"name\":\"Ada\"}" yields the characters {"name":"Ada"}. Those characters are themselves JSON, so a second parse yields an object with one key. The status is unwrapped, the root is object, and the body is indented with two spaces. That is the whole feature. A single parse would have left you holding a string and wondering where the object went.

Already structured. Pasting {"name":"Ada"} without the outer quotes parses as an object the first time. The status is already structured, the root is object, and the pretty text follows. The note says nothing was unwrapped. This matters because a button that always parsed twice would throw on an honest object. The JSON parser only does the first parse and reports a line and column when it fails. The JSON formatter indents a value and can sort keys. This page’s question is narrower: was this a string containing JSON?

A string that is not JSON. If the outer quotes come off and the inside is ordinary prose, the second parse fails. The status is plain string and the text is shown. That is a successful diagnosis, not a crash. You asked to unwrap and there was no JSON inside.

Invalid text. If the first parse fails, the page stops with an error. A wrapped object still needs to be valid JSON at the outer level, which means the quotes and the backslashes have to balance. The tool will not guess which backslashes you meant. Fix the text until the first parse succeeds, then read the status.

Limits. Twenty thousand characters. Two-space indent. No key sorting. No comment stripping. One value. The pretty text is for reading. It is still JSON, so you can paste it into a formatter if you need a different indent.

Logs. A log line often wraps a payload in quotes and escapes every inner quote. That is the shape the sample uses. Copy only the JSON value, including its outer quotes, not the timestamp in front of it. If the first parse fails, the timestamp is still there. Delete it and try again. The tool will not search the line for a brace and hope.

Indent. Two spaces, every level. A one-line object becomes several lines, which is what you want when you are reading, and noisy when you are diffing a minified file. If the diff is the point, stop after you have confirmed the status and do not commit the pretty form by accident.

Worked examples

A quoted object

Inputs: JSON text: "{\"name\":\"Ada\"}"

Paste "{\"name\":\"Ada\"}" with the outer quotes and the escaped inner quotes, then press Unwrap. The status is unwrapped and the name is Ada.

Result: Status: unwrapped Root: object { "name": "Ada" }

An object that is already JSON

Inputs: JSON text: {"name":"Ada"}

Paste {"name":"Ada"} without an extra set of quotes and press Unwrap. The status is already structured.

Result: Status: already structured Root: object { "name": "Ada" } Nothing to unwrap. The text was already a JSON value, not a string containing JSON.

Use cases

  • Reading a JSON string that a log wrapped in quotes.
  • Checking that a payload is already an object before you unescape it.
  • Pretty-printing the value that was hiding inside a string.
  • Separating “not JSON” from “JSON that was stringified”.

Tips & limitations

  • Read the status before you copy the body.
  • Use the parser when you need the column of a syntax error.
  • A second parse only happens when the first result is a string.
  • Outer quotes have to be real JSON quotes, not fancy quotes.

FAQ

Why parse twice?

The first parse removes the wrapping string. The second parse reads the JSON that was inside it.

What if I paste an object directly?

The status says already structured. The value is pretty-printed and nothing is unwrapped.

What if the inside is a sentence?

The status says plain string and shows the sentence. The second parse did not find JSON.

Will it sort keys?

No. Order is the order in the text. Use the formatter if you want a sort.

Does it accept comments?

No. Comments are not JSON. The first parse fails.

Is the text uploaded?

No. Both parses run in the browser.

Runs entirely in your browser; nothing is uploaded. Check the output before you rely on it in production code, data or security decisions.