Formattatore JSON
Formatta, valida e minifica JSON all'istante. Gli errori sono evidenziati con riga e colonna.
Inserisci un input sopra per vedere il risultato.
What is this for?
JSON travels minified — every byte counts when an API response is being shipped. But minified JSON is unreadable. This tool round-trips through the browser's native JSON.parse / JSON.stringify to produce indented, copy-able output, validate the structure, or strip whitespace back out. Nothing is uploaded; everything happens in the page.
When to use it
- Pasting a minified API response and getting back something a human can scan.
- Catching syntax errors — trailing commas, unquoted keys, smart quotes — with the exact line/column the parser tripped on.
- Stripping whitespace before pasting JSON into a context where size matters (URL params, env vars, config files).
- Confirming your hand-written JSON is valid before piping it into another tool.
Common gotchas
- JSON ≠ JavaScript object literal. Keys must be in double quotes. Single quotes, unquoted keys, and trailing commas all fail. If you've got JS object literals, run them through a converter first.
- Smart quotes from copy-paste. Word processors and chat apps love to "helpfully" replace
"with"/". Those aren't valid JSON delimiters. - JSON has no comments. If your "JSON" has
//or/* */, it's actually JSONC (used by VS Code config) — strip those before parsing. - Numbers larger than 2⁵³. JavaScript can't represent integers above
9007199254740992exactly. Twitter snowflake IDs and similar should be quoted as strings.