Guide
Why use a JSON formatter?
Minified JSON is unreadable to a person: one line of ten thousand characters hides the structure and hides the mistake. This tool re-indents the document, shows the tree of keys, and — when something is broken — points at the line and column of every problem and names what went wrong, instead of the generic “Unexpected token”.
Tolerant mode also understands the common departures from strict JSON: trailing commas, single quotes, unquoted keys, comments, and Python values like True and None. Repair rewrites all of that into valid JSON, and warns separately when a fix changed the data rather than the writing — a duplicate key that dropped a value, or an integer too large to survive a 64-bit float.
When to use the JSON formatter
Debug an API response
Paste the response body, read the structure as a tree, and use JSONPath to reach the one field you need without scrolling thousands of lines.
Fix a config file
A package.json or tsconfig.json that refuses to load usually has a trailing comma or a comment. Repair names the problem and strips it.
Get data into a spreadsheet
Turn a list of objects into CSV, with nested objects flattened into dotted columns, and open it straight in Excel or Google Sheets.
Compare two environments
Paste production config on one side and staging on the other to see exactly which keys differ, and which changed type.
Generate TypeScript types
From one sample response, walk away with the interfaces — optional properties included, where a field is missing from some items in a list.
Escape JSON inside JSON
When a whole document has to fit inside another document's string field, the Escape tab handles the round trip without miscounting backslashes.
How it works
Paste JSON into the editor, drop a .json file onto it, or hit Sample to see the tool working. The status strip says immediately whether the document is valid and reports size, lines, nodes, depth and key count. Problems appear in a list below it — click any one to jump to its line.
The tabs at the top change what the output shows: Formatted, Tree, Query with JSONPath, Convert to another format, Compare two documents, and Escape text. The footer holds the actions that rewrite the editor: Format, Minify, Repair, an indent of 2 spaces, 4 spaces or a tab, sorting keys alphabetically, and strict mode, which rejects everything the specification rejects.
Frequently asked questions
Is the JSON I paste sent to a server?+
No. Reading, formatting, repairing, querying, converting and comparing all happen inside your browser, in JavaScript. Not one byte of your document leaves your device, nothing is logged and nothing is uploaded. That is why you can paste a production payload here without asking anyone's permission.
How do I find where my JSON breaks?+
Every problem appears in a list below the editor with its exact line and column. Clicking a problem scrolls the editor to that line and highlights it. Unlike the browser's own JSON.parse, which stops at the first error and only says “Unexpected token”, this shows every problem in the document at once and names each one.
What does “Unexpected token” actually mean?+
It is the generic message JavaScript produces when it meets a character where none was allowed. In practice it is almost always one of five things: a trailing comma before a } or ], single quotes instead of double, an unquoted key, a // or /* */ comment, or a string that opened and never closed. All five are named individually here, and the Repair button fixes all five at once.
What is the difference between formatting and minifying?+
Formatting (also called beautifying) adds line breaks and indentation so a person can read the document. Minifying does the opposite: it strips every unnecessary space so the file is smaller on the wire. Both produce exactly the same data — the only difference is who the output is for, you or the network.
Can I use JSON with comments?+
The JSON specification has no comments, but config files use them constantly — it is the format VS Code calls JSONC. Tolerant mode reads // and /* */ comments without complaint, flags each as a warning, and Repair strips them, leaving strict JSON that any library will accept.
How do I convert JSON to CSV for Excel?+
Open the Convert tab and pick CSV. A list of objects becomes one row per object, with columns in the order the keys first appear; nested objects are flattened into dotted columns like address.city. If your Excel runs in a locale that expects semicolons, switch the delimiter from comma to semicolon.
Why does my large number come back different?+
Every number in JavaScript is a 64-bit float, and integers above 9,007,199,254,740,991 cannot fit without rounding. That affects every JSON tool, not just this one — the difference is that here you get an explicit warning when it happens. If the exact value matters, such as a long ID, store it as a quoted string.
What is JSONPath for?+
It is a short way to point at a piece of a document, the way XPath does for XML. $.users[0].name takes the first user's name; $..email finds every email field at any depth; $.items[?(@.price > 100)] filters a list by price. It finds a needle in a document of thousands of lines without scrolling.