WebTooli

JSON Formatter - Beautify, Minify & Validate JSON Online

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.

Recent: Your recent JSON inputs will appear here
πŸ“„
Drop a .json or .txt file, or click to browse
Paste JSON directly below, or drop a file
Input
0
Characters
0
Lines
0
Keys
0
Max depth
—
Root type
Formatted output
—
β„Ή️ Tree view shows the parsed structure of your JSON as an expandable tree. Click the arrows to collapse or expand sections. Click any key name to copy its JSONPath (e.g. $.repository.url) — useful for referencing fields in code.
Structure Click a key to copy its JSONPath
No tree built yet. Paste JSON in the Beautify tab, then click "Build tree from input".
β„Ή️ JSONPath lets you query into a nested JSON structure. The query runs against the JSON in the Beautify / Minify input. Supported syntax: $.key, $.items[0], $.users[*].email, $..id (recursive descent).
β„Ή️ Validation parses your JSON and reports whether it is syntactically valid. If there is an error, the tool shows the exact line and column where parsing failed, along with a small snippet of context.
Validate
All processing runs locally in your browser. No data is uploaded or stored.
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?
Paste your JSON into the input area. Choose 2 spaces, 4 spaces, or tab indentation. Click Beautify. The tool parses the JSON and returns syntax-highlighted output. Click Minify for the opposite. A minified payload is typically 30% to 60% smaller than a pretty-printed version.
How does the JSON validator report errors?
The validator parses the input. If it fails, it converts the parser's character position into a line number and column number. Then it shows a snippet of the surrounding lines so you can see exactly where the syntax error is. Common causes include trailing commas, missing quotes, and unquoted keys.
What JSONPath syntax does the query tool support?
The engine supports $.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.
← Back to all tools