๐Ÿงพ

JSON Formatter & Validator

Format, beautify, validate and minify JSON with clear error messages and a collapsible tree view.

Built and maintained by Abdur Rehman ยท Free, no sign-up

Loading JSON Formatter & Validatorโ€ฆ
๐Ÿ”’PrivateRuns in your browser โ€” nothing is uploaded.
โšกFastInstant results, no waiting in queues.
๐Ÿ’ธFreeNo sign-up, no watermark, no limits.
๐Ÿ“ฑAnywhereWorks on phone, tablet and desktop.

How to use the JSON Formatter & Validator

  1. Paste your JSON
  2. Click Format, Minify or Validate
  3. Copy or download the result

Format, validate and minify JSON

Paste JSON to pretty-print it with your choice of indentation, check that it is valid, or minify it into one compact line for APIs and config files. When the JSON is invalid, the error message points to the line and position of the problem.

Most common JSON errors

  • Trailing commas โ€” {"a": 1,} is not allowed in JSON.
  • Single quotes โ€” strings and keys must use double quotes: "name", not 'name'.
  • Unquoted keys โ€” {name: "x"} is JavaScript, not JSON.
  • Comments โ€” JSON has no comments; remove // and /* */.

Your data stays in your browser, so it is safe to format API responses containing tokens or personal data.

Beautify, minify or explore as a tree

Format / Beautify re-indents the JSON with 2 spaces, 4 spaces or tabs. Minify removes every unnecessary space and line break, which makes API payloads and config values smaller. Tree view shows the data as collapsible objects and arrays โ€” the quickest way to understand a large API response you didn't write.

Sort keys for clean comparisons

Tick Sort keys to put every object's keys in alphabetical order, at every level. Two JSON files with the same data but keys in a different order then format identically, so you can paste both into Text Compare and see only the real differences.

Reading the error message

When the JSON is invalid you get the parser's reason plus the exact line and column, for example โ€œUnexpected token } (line 14, column 3)โ€. The real mistake is usually just before that point โ€” most often a missing comma at the end of the previous line, or an extra one before a closing bracket.

Copy or download

Copy the result to the clipboard, or download it as a .json file. The size shown after a successful check is the size of the JSON as entered, which helps when an API or database field has a size limit.

๐Ÿ’ป Keep exploring Developer Tools

See all Developer Tools