JSON Formatter
About the JSON Formatter
Paste JSON to validate it and pretty-print it instantly. Errors are reported with their line and column, and you can minify, sort keys, repair common mistakes, browse the document as a tree or look up a value by path. It is made for developers debugging API responses and config files.
How to use it
- 1 Paste your JSON into the Input JSON pane, or click Example to load a sample.
- 2 Read the status bar: valid JSON is formatted automatically, and invalid JSON shows the line and column of the error.
- 3 Use Format, Minify, Sort keys or Repair, and set Indent to 2 spaces, 4 spaces or Tab.
- 4 Switch to Tree or Inspect to explore the structure or run a path query such as users[0].name.
- 5 Copy the output or Download it as formatted.json.
Frequently asked questions
Repair removes comments, trailing commas and a leading byte-order mark, and turns curly smart quotes into straight quotes. It runs only when you click Repair, and the status bar lists every change it made.
Common causes are trailing commas, single-quoted strings, unquoted keys and comments, none of which JSON allows. The status bar gives the line and column where parsing stopped, so you can go straight to the problem.
In the Inspect view, use dot and bracket notation: users[0].name, or $["complex key"] for keys with spaces or symbols. The query shows the value at that path, or says the path was not found.
No. Sort keys orders object keys alphabetically at every level of nesting, but array items keep their original order, because their position carries meaning.
Up to 100,000 characters. Larger input is refused with a message rather than cut short, because a truncated document is never valid JSON.