JSON string
JSON
Empty Runs in your browser

JSON Parser - Parse JSON String Online

Paste a stringified JSON value, such as one copied from a log, a database column or an API that encoded JSON twice, and get the real JSON back, formatted and ready to explore as a tree.

How to parse a JSON string

  1. Paste the stringified JSON into the left editor. It can have its surrounding quotes, such as "{\"id\":1}", or not, such as {\"id\":1}.
  2. The parsed JSON appears on the right, formatted. Switch to tree view to fold and explore it.
  3. Copy the result or download it as a .json file.

What is a stringified JSON?

JSON is stringified when a JSON document is stored as the value of a string, so all of its quotes are escaped with backslashes. You see it in log files, in database columns of type text, in message queues, in the body field of AWS Lambda and API Gateway events, and in APIs that call JSON.stringify on a value that is already JSON.

Sometimes the same value has been encoded two or three times, which produces runs of backslashes such as \\\". The parser keeps decoding until it reaches real JSON, up to ten layers, and the status line tells you how many layers it removed.

Parser or validator?

The parser also accepts ordinary JSON, in which case it just formats it. If the input is neither valid JSON nor a valid JSON string, the error is shown with its line and column, as in the JSON Validator. If the string decodes to text that is not JSON, the text is returned as a JSON string.

Example

"{\"order\":{\"id\":1042,\"items\":[{\"sku\":\"A-1\",\"qty\":2}]}}"

becomes:

{
  "order": {
    "id": 1042,
    "items": [ { "sku": "A-1", "qty": 2 } ]
  }
}

To turn JSON back into a string, use the JSON Escape tool.

Private by design

The parsing happens in your browser. Logs and payloads you paste here are never uploaded.

Frequently asked questions

How do I parse a JSON string?

Paste the stringified JSON, with or without its outer quotes. The parser decodes it and shows the real JSON, formatted, on the right.

What is double-encoded JSON?

JSON that was turned into a string more than once, which produces runs of backslashes such as \\". The parser keeps decoding until it reaches real JSON and tells you how many layers it removed.

Where does stringified JSON come from?

Logs, database text columns, message queues, the body field of AWS Lambda and API Gateway events, and APIs that call JSON.stringify on data that is already JSON.

How do I parse JSON in JavaScript?

Use JSON.parse(text). If the result is still a string, the JSON was encoded twice, so call JSON.parse on the result again.

Editor settings

Type

{
  "id": 1024, "name": "Ada", "active": true,
  "tags": ["0O", "1lI", "=> != >="], "manager": null
}

Colour theme

Code editor

Defaults

Send feedback

How is online-json working for you?