JSON Formatter

Paste JSON, then format or minify. The result is the same value with different spacing. If the text is not JSON, the status line shows the parser’s message. See the valid JSON guide for what this tool accepts.

Limit: 400 KB. Ctrl or Cmd+Enter formats.

What counts as JSON here

The formatter uses the browser’s JSON parser. Keys must be in double quotes. Trailing commas, single quotes, and comments are errors. Format uses a two-space indent. Minify writes the same value on one line. Numbers, strings, arrays, objects, true, false, and null are the only values.

When this tool helps

Use the formatter when an API response arrived as one long line and you need to read it. Use minify when a config file must be compact. The page does not repair broken JSON and does not send the text anywhere. If you need comments in a config, that is a different language, not JSON.

Questions

Why did a trailing comma fail?

JSON does not allow a comma after the last item in an array or object. Remove that comma and format again.

Does format change the data?

No. Spacing changes. The parsed value is written out again. Key order follows what the parser kept.

Does the text leave this tab?

No. Parsing and writing run in the browser.