JSON Formatter to beautify, minify, and validate JSON instantly. Includes collapsible tree view, syntax highlighting, JSONPath query, configurable indentation, error detection with line numbers, and key sorting. Free, private, no signup.
—
$.repository.url) — useful for referencing fields in code.
$.key, $.items[0], $.users[*].email, $..id (recursive descent).
Tip: press ⌘/Ctrl + Enter inside any textarea to run the active panel's action.
A missing comma in a 500-line JSON file is impossible to find by eye.
You paste it into an online tool. It says "invalid JSON" and nothing else. You scroll. You squint. You guess.
This JSON formatter tells you the exact line and column. It shows three lines of context. A caret points at the character where parsing failed.
The fix takes seconds. Not minutes.
Four tabs. Four ways to inspect JSON.
Beautify / Minify. Paste raw JSON. Choose 2-space, 4-space, or tab indentation. The output is syntax-highlighted. Click Minify to strip all whitespace for API requests.
Tree View. Shows the parsed structure as an expandable tree. Collapse objects and arrays. Click any key to copy its JSONPath.
JSONPath. Run queries like $.users[0].name or $..id. Extract values from deeply nested data without manual traversal.
Validate. Parse and check syntax. On error, get line number, column number, and a snippet of surrounding code.
The four most common JSON syntax errors
Trailing commas. {"a":1,} is invalid in strict JSON. Valid in JavaScript objects. Many developers write it out of habit.
Unquoted keys. {a:1} fails. JSON requires double quotes on every key.
Single quotes. {'a':'b'} fails. JSON uses double quotes only.
Comments. // ... is not allowed in standard JSON. JSONC and JSON5 allow comments. The spec does not.
The validator catches all four. The error message names the position. You do not have to guess.
Minify saves 30% to 60% on payload size
Pretty-printed JSON is for humans. Minified JSON is for machines.
Whitespace, newlines, and indentation are semantically meaningless. They add bytes. They do not add information.
A typical API payload shrinks 30% to 60% after minification. That matters for network requests, embedded configs, and database storage.
One click. Full round trip.
JSONPath without the learning curve
JSONPath is to JSON what XPath is to XML. A query language for nested structures.
The tool supports the patterns most developers actually use. $.key for object access. $.items[0] for array index. $.users[*].email for wildcards. $..id for recursive descent.
Six example queries are one click away. No need to memorize syntax.
Key sorting for deterministic output
JSON objects do not guarantee key order. In practice, most parsers preserve insertion order. But "in practice" is not "spec."
Enable sort keys and the formatter reorders every key alphabetically at every level. Useful for comparing two payloads, generating deterministic output for version control, or tidying a config file with inconsistent ordering.
What this JSON formatter does not do
It does not repair invalid JSON. If your JSON has a syntax error, the tool reports it. It does not guess what you meant.
It does not convert JSON to other formats. No CSV. No XML. No YAML. That is a separate tool.
It does not fetch JSON from a URL. You paste it or upload it.
It does not stream very large files. Very large payloads may slow down the browser tab. The native JSON.parse handles most files without lag.
Privacy and speed
Everything runs in your browser using the native JSON.parse and JSON.stringify APIs. No JSON payload, config file, or API response leaves your device.
No uploads. No accounts. No ads inside the tool.
Recent inputs and last-used settings are saved in localStorage on your device. Up to 10 entries. Clear your browser data and they are gone.
Frequently Asked Questions
How do I format or minify JSON online?
How does the JSON validator report errors?
What JSONPath syntax does the query tool support?
$.key for object access, $.items[0] for array indexing (negative indices work too), $.users[*].email for wildcards, $..id for recursive descent, and $['key with spaces'] for bracket notation. Enter a path in the JSONPath tab and click Run query.