JSON Formatter & Validator
Format, minify and validate JSON with precise error locations, a collapsible tree view and JSONPath filtering.
Runs entirely in your browser — nothing is uploadedInput
Output
About the JSON Formatter & Validator
Paste unformatted JSON and get it back readable, or minified for transport. Invalid JSON produces a precise line and column for the failure plus a plain-English explanation, rather than the usual unhelpful "Unexpected token" message.
The collapsible tree view makes deeply nested API responses navigable, showing types and array lengths at a glance. JSONPath filtering lets you extract just the part you care about from a large payload — $.data.items[*].id and similar — without writing a script.
Additional modes: sort keys alphabetically for stable diffs, escape or unescape JSON as a string (for embedding in another document), and generate a TypeScript interface from a sample payload, which saves a surprising amount of typing when integrating a new API.
API responses regularly contain access tokens, customer records and internal hostnames. Pasting those into a server-side formatter is a real, routine data leak — which is the reason this one is local-only.
Everything runs inside your browser using standard web APIs. Your data is never uploaded, never stored on a server, and never leaves your device — you can confirm that by opening your browser devtools Network tab, or by switching off your Wi-Fi and using the tool offline.
Frequently asked questions
Why does my JSON fail validation?
The most common causes are trailing commas, single quotes instead of double quotes, unquoted keys, and comments — all valid JavaScript but none valid JSON. The error message points at the exact line and column so you can find it quickly.
Can it handle very large JSON files?
Files into the tens of megabytes format fine. The tree view virtualises long arrays so rendering stays responsive even with thousands of elements.
What is JSONPath?
A query language for JSON, roughly what XPath is for XML. $.store.book[*].author selects every author in an array of books. It is the fastest way to pull one field out of a large nested response.
Does formatting change my data?
Almost never — but there is one real caveat. Formatting round-trips your JSON through the browser's parser, and JavaScript numbers are IEEE-754 doubles, so an integer beyond 2^53 (about 9.007e15) loses precision: 12345678901234567890 comes back as 12345678901234567000. Duplicate keys also collapse to the last one. The tool detects both cases and warns you. Everything else — values, types, and array order — is preserved exactly.