Formattatore e validatore JSON
Valida, formatta o minimizza JSON in locale. I dati non validi non vengono mai inviati a un server.
Dati
Suggerimento: premi Ctrl + Enter per eseguire
Impostazioni salvate
Per ora la guida dettagliata qui sotto è disponibile solo in inglese.
Informazioni su questo strumento
API responses, configuration files and log entries often arrive as one long line of JSON. This tool checks that the text is valid JSON and then either indents it for reading (pretty) or removes all unnecessary whitespace (minify) for sending or storing. Because it runs in your browser, you can safely format responses that contain customer data or access tokens.
If the input is not valid JSON, it tells you so rather than guessing. JSON is strict: keys and strings need double quotes, and trailing commas are not allowed.
Come si usa
- Paste the JSON text.
- Choose pretty to indent it with two spaces, or minify to put it on one line.
- Run the tool.
- Copy or download the result; if you get an error, fix the reported problem and run it again.
Come funziona il calcolo
The text is parsed with the browser’s standard JSON parser and written back with JSON.stringify, either with two-space indentation or none. Key order and values are preserved; numbers keep their JavaScript double-precision value.
JSON.parse → JSON.stringifyEsempio pratico
An order API returns {"order":1042,"items":[{"sku":"A-1","qty":2}],"paid":true}. Pretty mode lays it out over ten lines with nested indentation, making it obvious that "items" is an array containing one object with "sku" and "qty". Pasting {'a':1} with single quotes instead gives an invalid JSON error.
Esempio di input e risultato
{"a":1}Limiti
- Strict JSON only (no JSON5 comments or trailing commas).
- Integers above 2^53 lose precision.
- Up to 100,000 characters.
Ultimo aggiornamento:
Domande frequenti
Why is my JSON rejected?
Common causes are single quotes, trailing commas, comments, unquoted keys and special values like NaN. These are allowed in JavaScript but not in JSON.
Does it change my data?
No, except that very large or very precise numbers are limited to JavaScript’s number precision (about 15–17 significant digits).
Can it sort keys?
No. Keys stay in their original order.
Risoluzione dei problemi
Large IDs changed their last digits.
Numbers above 9,007,199,254,740,991 cannot be stored exactly. Ask the API to send IDs as strings.
It fails on a file copied from a log.
Logs often contain several JSON objects, one per line. Format one object at a time.
I need YAML.
Use the JSON ↔ YAML converter.
Privacy & Gratuito
I miei dati vengono salvati?
I tuoi dati restano in questa scheda. Non riceviamo i tuoi file, i testi incollati né i valori dei calcoli.
Questo strumento è gratuito?
Sì. Non servono registrazione né pagamento.
Vedi anche
Passi successivi utili
Convertitore da CSV a JSON
Converti intestazioni e record CSV in JSON, con delimitatori tra virgolette e a capo.
Sviluppo e SEOConvertitore da JSON a CSV
Converti un array piatto di oggetti in CSV. Le stringhe simili a formule ricevono un prefisso protettivo per i fogli di calcolo.
Sviluppo e SEOCodificatore e decodificatore Base64
Codifica testo UTF-8 in Base64 o decodificalo. Base64 è una codifica, non una cifratura.
Sviluppo e SEO