Text
JSON formatter
Pretty-print JSON, minify it, or find the broken line.
How to use it
- Paste JSON into the box.
- Choose Format for an indented document, or Minify for a single line.
- If the JSON is broken, read the line and column and fix that spot.
The check is the browser’s own parser
Format and minify both run JSON.parse. A document that parses is then written back out with JSON.stringify, either with two-space indentation or with no extra space. Comments and trailing commas are not allowed, because they are not JSON.
The error line and column are counted from the character position the parser reports. The count starts at line 1, column 1. Tabs count as one column.
Nothing is stored
The text stays in this tab. Do not paste secrets you would not want left in a shared screenshot. Closing the tab clears the box.
Questions
Will it fix my JSON for me?
No. It tells you where the parser stopped. It does not guess a missing comma.
Does minify change the data?
It removes insignificant space. Key order is the order the parser produced. Numbers stay numbers.
Can I format several files?
Paste one document at a time. A file on disk is not read.