JSON Formatter & Validator

Format, validate, minify, and explore JSON with a live tree view

Input

Tree view

Valid JSON will appear here as an explorable tree.
Nothing you paste here is ever uploaded — all formatting and validation happens locally in your browser.

About this tool

This parses your JSON with a real parser rather than a regex, so it can point to the exact line and character where something breaks instead of just saying "invalid JSON." Valid input gets a collapsible tree view for exploring nested objects and arrays, a minify mode for stripping it down to one line, JSONPath-lite queries for pulling out specific values, and a conversion path into CSV for flat, tabular data.

What usually causes a JSON syntax error?

The most common culprits are a trailing comma after the last item in an object or array (which JSON, unlike JavaScript, doesn't allow), single quotes instead of double quotes around strings and keys, and unescaped control characters inside string values. The precise error location this tool reports makes those much faster to spot in a large file.

What is JSONPath and how does the query feature use it?

JSONPath is a small query language for navigating JSON, similar in spirit to how XPath navigates XML — expressions like $.users[0].email let you drill straight to a nested value instead of scrolling through a large tree by hand. The querying here supports the common subset of that syntax for exactly this kind of lookup.

Can any JSON be converted to CSV, or only certain shapes?

CSV conversion works best on JSON that's an array of similarly-shaped objects, since each object becomes a row and its keys become columns. Deeply nested or irregular structures don't map cleanly onto rows and columns, so flat, list-like JSON gives the most useful CSV output.