JSON Formatter & Validator

Beautify, minify and validate JSON with clear errors.

Paste JSON from an API response, a config file or a log and this tool makes it readable with consistent indentation, or squeezes it into one line to save space. It also validates the JSON and, when something is wrong, points to the line and column where the problem starts.

How to use it

  1. Paste your JSON into the input box.
  2. Click Format to pretty-print it, or Minify to remove all whitespace.
  3. Optionally sort object keys alphabetically to make two files easier to compare.

Common JSON errors

  • Trailing commas. [1, 2, 3,] is valid in JavaScript but not in JSON.
  • Single quotes. JSON strings and keys must use double quotes.
  • Unquoted keys. {name: "x"} must be written {"name": "x"}.
  • Comments. Standard JSON has no comments. Remove lines starting with // before validating.

Frequently asked questions

Is my data uploaded?

No. Parsing uses your browser’s built-in JSON engine, so API keys or customer data in the JSON never leave your computer.

How large a file can it handle?

Several megabytes is fine in a modern browser. Very large files may take a moment to format.