Overview
JSON is the lingua franca of modern software, and also one of its great time sinks: APIs return it minified into an unreadable wall, config files break on a single misplaced comma, and debugging means squinting. A formatter turns the wall back into a document — indented, nested, scannable — so the structure your eyes need is the structure you get.
This one does the full job: pretty-printing with your choice of indentation, one-click minify for the trip back, standalone validation that changes nothing, and — unusually — the real error message from the browser's parser when input is invalid, plus a structural census of keys, objects, arrays, depth and size.
What does “valid JSON” actually require?
Less than most people assume, and the strictness surprises everyone once. Keys and strings need double quotes — single quotes are forbidden. Trailing commas are illegal. Comments do not exist. Numbers cannot have leading zeros, and bare words like undefined are not values. It is a deliberately small grammar, which is why it is reliable across languages — and why hand-written JSON breaks so often.
Validation means checking text against that grammar without changing it. The browser's built-in parser does this natively and quickly, and its error messages point at the actual fault. This tool surfaces those messages verbatim instead of paraphrasing them into uselessness.
Features
- Pretty-print your way — two spaces, four spaces or tabs, applied through every level.
- One-click minify — strips non-essential whitespace for the smallest faithful version.
- Standalone validation — check correctness without altering a character.
- Honest errors — the parser's own message, pointing at the real problem.
- Structural stats — key count, objects, arrays, maximum depth and byte size.
- Copy and download — clipboard in one click, or save as a .json file.
- Completely local — your browser's JSON engine does the work; nothing is stored.
Benefits
- Read APIs again. Minified responses become navigable documents.
- Find the comma. Real error messages beat an hour of squinting.
- Know your data's shape. Stats reveal structure at a glance.
- Keep secrets secret. Tokens and configs never leave the tab.
Who can use it
Developers debugging API responses, anyone hand-editing config files, QA engineers comparing payloads, students learning the format, and support staff reading what an application actually sent. If your job involves staring at curly braces, this page earns its bookmark.
How to use
- Paste your JSON into the input box.
- Choose pretty-print (pick an indent style), minify, or validate-only.
- Read the result — or the parser's error message if it fails.
- Check the structural stats for a quick sense of the document's shape.
- Copy the result or download it as a .json file.
Frequently asked questions
Why did my JavaScript object fail validation?
Because JSON is stricter than JavaScript object literals. Single-quoted strings, trailing commas, comments and undefined are all fine in JS but illegal in JSON. The fix is mechanical: double-quote every key and string, drop trailing commas, delete comments. The error message points at the first offence — fix it and revalidate.
What is minification actually for?
Shrinking payloads. Whitespace is invisible to parsers but costs bytes on every request, so production APIs and configs ship minified. You pretty-print to work and minify to ship; the tool's one-click minify makes the round trip painless.
How large a document can it handle?
Comfortably into the megabytes — the browser's native parser is fast. Pasted text lives in the page's memory, so truly enormous files may feel sluggish, but anything an API would return is instant.
Do the stats include nested keys?
Yes — the key count walks the entire tree, and maximum depth tells you how deep the nesting goes, which is genuinely useful when deciding whether a structure has grown unwieldy.
Is my JSON uploaded?
Never. Parsing happens in your browser; the text you paste is never transmitted, logged or stored.
Conclusion
JSON deserves better than squinting at a minified wall. Paste it in, shape it with your preferred indentation, validate it against the real parser with honest error messages, and check the structural stats before you ship — all inside your own browser, where tokens, configs and private payloads belong.