go-supertools
Developer & Data Tools

JSON Beautifier

Online JSON Viewer, JSON Beautifier and Formatter to beautify and tree view of JSON data.

Runs in your browser Your input never leaves your device.

0 characters | 0 words

About this tool

Paste minified or messy JSON and get it back indented and readable, with a choice of 2 or 4 spaces. Formatting happens in your browser using the standard JSON parser, so the data is never uploaded. Because the text is fully parsed first, the tool doubles as a quick syntax check: if the JSON is invalid you get the parser's error message instead of output. Formatting changes only whitespace — keys, values and their order stay the same.

How to use it

  1. Paste your JSON into the input box.
  2. Choose 2 or 4 spaces for the indent.
  3. Read the formatted result below, or fix the error message if the JSON is invalid.
  4. Copy the output.

Example

Minified input, 2-space indent:

Input
{"name":"John","age":28,"tags":["a","b"]}
Result
{
  "name": "John",
  "age": 28,
  "tags": [
    "a",
    "b"
  ]
}

Common problems

Trailing comma
JSON does not allow a comma after the last item in an object or array. Remove it.
Single quotes or unquoted keys
Keys and strings must use double quotes. {name: 'x'} is JavaScript, not JSON.
Comments in the JSON
Standard JSON has no comments. Remove // and /* */ before formatting.
Unexpected token at a position
The error shows where parsing failed; look just before that position for a missing comma, quote or bracket.

Frequently asked questions

Does formatting change my data?

No. Only whitespace changes; keys, values and their order stay the same.

Is my JSON uploaded anywhere?

No. The formatting runs entirely in your browser.