JSON Formatter & Validator

Pretty-print, minify and validate JSON with pinpoint errors, auto-fix and a tree view.

Runs locally · nothing uploaded
Input
Output

What it does

Paste JSON and it is validated and formatted as you type. When something is wrong you get the exact line and column, a plain-English explanation (“Trailing comma before }”, “Property names must be in double quotes”) and a snippet with a caret under the problem. Go to error puts the cursor right there in the input.

Features

  • Pretty or minified output with 2 spaces, 4 spaces or tabs.
  • Sort keys alphabetically at every level, which makes two documents easy to compare.
  • Auto-fix repairs the usual copy-paste damage before parsing: // and /* */ comments, trailing commas, single-quoted strings, unquoted property names, Python True/False/None, raw line breaks inside strings and non-breaking spaces. The status line lists every repair it made.
  • Lossless formatting: numbers are written exactly as you typed them, so 12345678901234567890 and 1.10 are not rounded or rewritten, and string escapes are kept.
  • Tree view with collapsible nodes, expand/collapse all, and the JSONPath of the node you click (for example $.orders[0].total), ready to copy.
  • Stats: input and output size, number of keys, objects, arrays and the maximum nesting depth. Duplicate keys are reported as a warning.

How to use it

  1. Paste JSON, open a file or drop one onto the input.
  2. Pick Pretty or Minify and the indent you want.
  3. Copy or download the result. Ctrl+Enter formats immediately.

Privacy

Parsing and formatting happen in your browser. Nothing is uploaded; your last input is kept in local storage so a page refresh doesn’t lose it. Use Clear to remove it.