JSON
JSON Formatter / Minify / Validator
Formattazione (indentazione di 2 spazi), minificazione e validazione di JSON direttamente nel browser.
JSON Formatter turns any JSON into a readable, indented form, compresses it into a single compact line, or checks it for syntax errors. Everything runs in your browser — nothing you paste is sent anywhere.
How to use it
- Format: paste JSON into the input — a 2-space indented result appears immediately.
- Minify: switch to Minify mode to get compact JSON with no whitespace, ready to embed in code or send over the network.
- Validate: if the JSON is invalid, the tool points to the exact line and character where the syntax error occurs.
Common uses
- Reading an API response that arrived as one long unbroken line.
- Checking configuration files (package.json, tsconfig.json, etc.) before a commit.
- Minifying JSON before pasting it into an environment variable or a one-line config.
Things to keep in mind
Formatting never changes data types or key order — only the whitespace and line breaks around values.
Valid JSON doesn't allow trailing commas, comments, or single quotes — if your input has those, run it through JSON Repair first.
Articolo su questo strumento: JSON Formatter: formattazione, minificazione e validazione
Domande frequenti
A cosa serve questo formattatore JSON?
Permette di formattare il JSON con indentazione a 2 spazi, comprimerlo (minify) o semplicemente validarlo, tutto direttamente nel browser.
I dati che incollo vengono inviati a un server?
No, tutta l'elaborazione avviene lato client con JavaScript: il JSON incollato non lascia mai il browser.
Perché ottengo un errore anche se il mio JSON sembra valido?
Una causa comune è la virgola finale (trailing comma) dopo l'ultimo elemento di un oggetto o array: alcuni linguaggi la tollerano, ma non è valida in JSON puro. La minificazione, inoltre, rimuove solo gli spazi tra i token, non i caratteri all'interno dei valori stringa.
In cosa differiscono JSON5 o JSONC dal JSON standard?
Sono estensioni che consentono anche commenti, virgole finali e chiavi senza virgolette. Un validatore JSON rigoroso (come questo strumento) rifiuta correttamente un testo del genere — serve un parser separato che supporti esplicitamente JSON5/JSONC.
La formattazione modifica i tipi di dato, ad esempio i numeri?
No, formattazione e minificazione riorganizzano solo gli spazi e gli a capo attorno ai valori. Numeri, stringhe, booleani e null restano nella loro forma originale.