JSON Formatter
Paste JSON to format, validate and explore it. Errors point to the exact line and column; the tree view gives you the path of any value.
$How it works
Your JSON is parsed with the browser’s own JSON.parse, so what passes here will parse in JavaScript, Node and any standards-compliant library. When parsing fails, a second strict parser walks the text to find the exact line and column and explain the problem in plain words: trailing commas, single quotes, unquoted keys, comments, NaN, a missing comma between values.
Formatted pretty-prints with 2 spaces, 4 spaces or tabs. Minified strips every optional space and line break. Sort keys orders object keys alphabetically at every level, which makes two JSON documents far easier to diff. The tree view renders lazily, so large files stay responsive; click any value to get its path, such as $.projects[0].title.
Questions
Is my JSON uploaded anywhere?
No. Parsing, formatting and the tree view all run in your browser. Nothing is sent to a server and nothing is saved except your indent and view preferences.
Why does it say “trailing comma”?
JSON does not allow a comma after the last item in an object or array, even though JavaScript does. Remove the comma just before the closing } or ] — the error box points to it.
Can JSON have comments?
Not in standard JSON. Formats like JSONC (used by VS Code settings) and JSON5 allow them, but JSON.parse and most APIs reject them. Delete the comments, or keep the data in a JSON5 file if you need them.
Why did a long number change after formatting?
JavaScript numbers are 64-bit floats and keep about 15–17 significant digits. An integer larger than 9,007,199,254,740,991 (for example a 19-digit ID) is rounded when parsed. If exact digits matter, store such IDs as strings.
How large a file can it handle?
Files of tens of megabytes work in a modern browser. Syntax colouring switches off above about 400 KB of output and the tree renders children in batches of 300, so the page stays responsive.