Skip to content
ErgaLab
JSON

JSON Formatter & Validator

Paste any JSON to pretty-print, minify, or validate it — invalid JSON is flagged with the exact line and column of the problem.

Paste your JSON

Valid JSON

Formatted output

3 keys · 3 array items · depth 2
{
  "name": "ErgaLab",
  "tools": [
    "regex",
    "sql",
    "json"
  ],
  "free": true
}

How it works

This tool parses your JSON using the browser's native JSON.parse, so validity checks are exactly as strict as what your code will encounter. When parsing fails, the raw error is translated into a line and column number instead of a raw character offset, so you can find the problem without counting characters.

Choose 2-space or 4-space pretty-printing, or minify to a single line for pasting into config files or request bodies. The optional "Sort keys A→Z" pass recursively sorts every object's keys alphabetically — useful for diffing two JSON payloads that should be equivalent but were serialized in a different key order.

Examples

Minified input, pretty-printed

Before: a single dense line.

{"name":"ErgaLab","free":true}

Same JSON, pretty-printed

After: 2-space indentation.

{
  "name": "ErgaLab",
  "free": true
}

Frequently asked questions