Skip to tool

Free online tool

JSON Formatter

Your input never leaves your browser.

What this tool does

Paste any JSON and the tool checks that it is valid, then reformats it with consistent indentation so it is easy to read. Parsing uses the browser's own built-in JSON parser, the same one your code runs on, so the result matches exactly what your program would actually accept or reject.

Worked example

Given {"name":"Ada","active":true,"tags":["math","computing"]}, the formatted result is:

{
  "name": "Ada",
  "active": true,
  "tags": [
    "math",
    "computing"
  ]
}

Indentation and key order

Choose 2 spaces, 4 spaces, or a tab character for indentation. Turning on "sort keys" alphabetizes each object's keys at every level, which is useful when comparing two JSON documents that should be equivalent but were written in a different key order.

Errors

If the JSON is invalid, the tool reports that clearly along with the approximate line and column where the problem was found, rather than trying to guess at a fix. Correcting a stray trailing comma or a missing quote is left to you; this tool intentionally does not attempt to repair broken JSON.

Tree view

An optional collapsible tree view lets you explore a large document's structure without scrolling through the raw text. It is purely a way of looking at the same parsed data and never changes the formatted text output.

Examples

  • Input: {"name":"Ada","active":true}

    Output: { "name": "Ada", "active": true }

Related tools