Skip to content

JSON Formatter & Validator

Pretty-print, minify and validate JSON, with precise error locations. Nothing leaves your browser.

About this JSON tool

Paste any JSON to format it with consistent indentation, minify it for transport, or sort object keys alphabetically so that diffs between two documents are easier to read. Parsing uses your browser's built-in JSON.parse, so the data never leaves your device.

Common JSON errors

  • Trailing commas: [1, 2, 3,] is valid JavaScript but invalid JSON.
  • Single quotes: strings and keys must use double quotes.
  • Unquoted keys: {name: "x"} must be {"name": "x"}.
  • Comments: JSON has no comment syntax; strip // and /* */.
  • Special numbers: NaN, Infinity and leading zeros like 012 aren't allowed.

Format or minify?

Formatted JSON is for humans: config files, logs, code review. Minified JSON removes whitespace for network payloads and storage, though for HTTP responses gzip or brotli compression usually matters more than minification.