JSON Formatter
Format, validate, minify and explore JSON. Click any key in the tree to get a smart predicate-based JSONPath instantly.
Click any pink key to get its smart JSONPath.
Smart JSONPath — Predicate-First, Index-Last
Unlike basic tools that always generate index-based paths, this tool analyses each array element's siblings to find a unique discriminator field (id, key, code, name…) and generates a predicate-based path that stays stable even when array order changes.
Reading Raw JSON Is a Developer Tax
Every developer who has stared at a single-line API response like {"status":"ok","data":{"user":{"id":42,"name":"Alice","roles":["admin","editor"]}}} knows the pain. The data is there. Finding it requires counting brackets and commas mentally. Multiply this by a hundred debugging sessions per week and you're bleeding hours that should go to shipping features.
A formatter doesn't just add indentation — it lets you see the structure at a glance. This tool goes further with an interactive tree view and a smart JSONPath generator. Click any key in the tree to get its navigable path. Build a path once, paste it into your code, and navigate straight to the value you need without hunting through nested braces.
Predicate-Based JSONPath: Why Index Paths Break
Index-based JSONPath — $.users[0].email — is brittle. The moment the array is sorted differently, paginated differently, or an element is inserted before index 0, your path points to the wrong record. This formatter generates predicate-based paths instead: it scans the siblings of any array element to find a discriminator field (id, key, code, slug, name, etc.) and produces a path like $.users[?(@.id==42)].email that stays accurate regardless of array order. When no discriminator is found, the index path is shown as a fallback with a clear label.
Format, Minify, Sort, Escape — Four Distinct Operations
Format adds indentation and newlines for human readability. Use it when reading API responses, debugging configuration files, or inspecting data payloads during development. Minify removes all unnecessary whitespace to produce the smallest valid JSON — use it before embedding JSON in a web page or sending it in a network request where size matters. Sort Keys alphabetises every object's keys, which is invaluable when comparing two JSON blobs with identical data but different key orders using the Diff Checker. Escape/Unescape handles the double-encoding that occurs when JSON is stored as a string value inside another JSON document.
Five Real Workflows This Tool Handles
- Debugging REST API responses: Paste the raw response body, click Format, and immediately see the full structure. Click any value to copy its JSONPath and use it directly in your code.
- Comparing configuration changes: Sort Keys on both the before and after JSON, then paste both into the Diff Checker to see only the meaningful differences.
- Inspecting JWT payloads: JWT tokens are Base64-encoded JSON segments. Decode the payload with the Base64 Encoder, then paste the JSON here to read the claims clearly.
- Preparing data for CSV export: Format and validate your JSON array, then convert it to a spreadsheet-ready CSV with the JSON to CSV converter.
- Reading minified production configs: Build pipelines often minify JSON configuration files. Format them here to edit, then minify again before re-deployment.
Validation Feedback While You Type
The status badge at the top of the output panel shows Valid, Invalid, or Empty in real time as you type or paste. When the JSON is invalid, the error panel shows the exact parse error with line and column information — the same level of detail you'd get from a JSON linter. Common mistakes like trailing commas, single-quoted strings, and unquoted keys are caught immediately.
Privacy and Data Security
This formatter operates entirely within your browser using JavaScript's native JSON.parse() and JSON.stringify(). No JSON is transmitted to any server — not on format, not on minify, not on file upload. It is safe to use with API keys embedded in configuration, personally identifiable data in test fixtures, and internal business records from CRM or ERP system exports.
✓Verified by ToollyX Team · Last updated June 2026
Frequently Asked Questions
Disclaimer: All JSON processing uses the browser's native JSON.parse() and JSON.stringify(). No data is transmitted to any server.