' + '

JSON Formatter

Format, validate, and minify JSON

How to Use the JSON Formatter

Paste any JSON string into the input box and click Format to pretty-print it with 2-space indentation, or Minify to strip all whitespace for transmission. Validate checks syntax without changing the content and reports the root type and key count.

Common JSON Pitfalls

Format vs. Validate vs. Minify

Format is for readability during development and debugging. Minify reduces payload size for API requests, config files, or storage where whitespace costs bytes. Validate is the right step before committing a JSON config file or seeding a database: it catches syntax errors without altering your content. All three operations run entirely in your browser — your JSON never leaves your machine.

JSON vs. JSON5

JSON5 is a superset that allows comments, single quotes, trailing commas, and unquoted keys. It is not valid JSON. If you see a .json5 file, you need a JSON5 parser, not a standard JSON.parse() call. This tool validates against the strict JSON spec (RFC 8259).