WebTooli
Advertisement
750 × 90

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.

v2
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.

JSON Formatter: Beautify, Minify & Validate JSON Online

JSON Formatter is a developer tool that takes raw, minified, or malformed JSON and turns it into readable, properly indented output — or compresses it back down for transport. It parses input with the browser's native JSON.parse, reports syntax errors with line and column information, shows the structure as an expandable tree, and lets you query into nested data with JSONPath.

Everything runs in your browser. No JSON payload is uploaded, no file is stored, and there is no sign-up. Whether you are debugging a REST API response, checking a config file before deploying, or preparing a payload for a test suite, the formatter gives you clean output in one click.

Why Use a JSON Formatter?

JSON is designed to be machine-readable, not human-readable. A typical API response is a single long line with no whitespace, which makes it nearly impossible to spot a missing bracket or an unexpected null. A formatter solves this in three ways: it makes the structure visible through indentation, it validates the syntax so errors surface immediately, and it lets you compress the output back down when you need to paste it into a config file or a request body.

Four Ways to Inspect JSON

Beautify. Parses the JSON and re-serializes it with 2-space, 4-space, or tab indentation. The output is syntax-highlighted — keys in one colour, strings in another, numbers, booleans, and null each with their own styling — so the structure is immediately clear.

Minify. Strips every unnecessary space, newline, and tab. A typical minified payload is 30% to 60% smaller than a pretty-printed version. This is what you want when pasting JSON into a request body, embedding it in a script, or storing it in a database column.

Tree view. Shows the parsed structure as an expandable tree. Objects and arrays can be collapsed, and each node shows its type and count. Click any key to copy its JSONPath — useful for referencing the exact path in your code.

JSONPath query. Run expressions like $.users[0].name, $.maintainers[*].email, or $..id (recursive descent) to extract specific values from deeply nested data without manually traversing the tree.

Error Reporting with Line and Column

When JSON is invalid, the browser's native error message includes a character position. The validator converts that position into a line number and column number, and displays a snippet of the surrounding lines so you can see exactly where the problem is. Common causes of parse failures — a trailing comma, a missing quote, a stray character — become obvious once the context is visible.

JSONPath Syntax Supported

The JSONPath engine supports the most common query patterns:

$.key — object key access. $.items[0] — array index (negative indices supported: [-1] for last). $.users[*].email — wildcard over an array or object. $..id — recursive descent: find every id at any depth. $['key with spaces'] — bracket notation for keys containing special characters.

Key Sorting

JSON objects do not have a defined key order, but in practice the order is preserved through most parsers. The formatter can optionally sort keys alphabetically at every level of the structure. This is useful for comparing two payloads, generating deterministic output for version control, or tidying up a config file with inconsistent key ordering.

Recent Items and Shareable Links

Every JSON input you format is saved to a recent items list — up to 10 entries, clickable to reload. And a "Share" button encodes the current JSON in the URL, so you can bookmark or send a specific payload to a teammate. Very large payloads are capped to avoid unsupported URLs.

Private, Fast, and Free

All processing runs locally in your browser using the native JSON.parse and JSON.stringify APIs. No JSON payload, config file, or API response leaves your device. There is no server-side processing, no logging, and no data retention.

Frequently Asked Questions

How do I format or minify JSON online?
Paste your JSON into the input area, choose your indentation (2 spaces, 4 spaces, or tab), then click Beautify. The tool parses the JSON and returns syntax-highlighted output with proper indentation. Click Minify for the opposite — a compact single-line output suitable for API requests. 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 and, if it fails, converts the parser's character position into a line number and column number. It then displays a snippet of the surrounding lines so you can see exactly where the syntax error is. Common causes include trailing commas, missing quotes, and stray characters.
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.
Kya yeh JSON formatter free hai?
Ji haan, yeh tool 100% free hai. Koi signup, watermark ya payment ki zaroorat nahi. Aap jitni baar chahein JSON files ko beautify, minify, validate, tree view mein inspect, aur JSONPath se query kar sakte hain.
Kya mera data kahin upload hota hai?
Nahi. Saari parsing aur formatting aap ke browser mein native JSON.parse aur JSON.stringify ke zariye hoti hai. JSON payloads, config files, aur API responses kabhi kisi server par nahi bheje jate. Aap ki recent history aur preferences sirf aap ke device par localStorage mein save hote hain.
Recent items aur share link kaise use karein?
Jab bhi aap JSON input karte hain, woh automatic recent history mein save hota hai (max 10 entries) — kisi bhi chip par click kar ke reload kar sakte hain. "Share" button se current JSON ka URL copy hota hai (#jf-<encoded> format) — jise bookmark ya share kar sakte hain. Bahut large payloads (2 KB se zyada) URL mein encode nahi hote.
← Back to all tools
Advertisement
750 × 90

WebTooli — Free Online Tools & Web Utilities

A curated collection of free web tools to boost your productivity — organized by category, running entirely in your browser.

Image Tools

Advertisement
750 × 90

PDF Tools

Text Tools

Advertisement
750 × 90

SEO Tools

Calculator Tools

Converter Tools

Advertisement
750 × 90

Developer Tools

Other Tools