JSON Formatter
Make JSON readable, find the exact line where broken JSON fails, or squeeze it onto one line.
This tool runs entirely in your browser; what you enter is never sent to our servers.
How to use it
- Paste your JSON into the left pane, or try it with “Sample JSON”.
- Press “Format”, “Validate” or “Minify”; choose the indentation at the top right.
- Copy the result from the right pane; if there's an error, its line number is highlighted in red.
Formatting, validating and minifying
Format: splits JSON into lines with the indentation you choose (2 spaces, 4 spaces or tabs) — ideal for reading API responses. Validate: checks the data against the JSON rules without changing it. Minify: strips all whitespace onto a single line, shrinking config files and request bodies. For invalid JSON we show the line and column whenever the browser's parser reports where the problem is. For {"name": "Ada",,} the position of the second comma is marked. If the parser gives no position, we show the message only — we never guess a location. The most common mistakes: a trailing comma after the last item, single-quoted strings, unquoted keys and an unclosed brace.