JSON
JSON Repair
Riparazione di JSON danneggiato — virgole superflue, apici singoli, chiavi senza virgolette, commenti, letterali Python (True/False/None) e altro — con un elenco di tutte le correzioni applicate.
Data that claims to be JSON often has small deviations from the spec: a trailing comma, single quotes, unquoted keys, Python literals like True/False/None instead of true/false/null. This tool fixes such issues automatically and lists every fix it applied.
How to use it
- Paste broken JSON and the tool immediately tries to fix syntax issues and shows the valid result.
- The list below shows each applied fix separately, so you can check exactly what changed.
- If it can't be repaired (the structure is too damaged), the tool points to the exact line where parsing stopped.
Common uses
- Fixing JSON copied from logs or a console, where strings may have been truncated or escaped incorrectly.
- Converting a Python-style dict (with True/False/None and single quotes) into valid JSON.
- Parsing an LLM response that promised JSON but added a comment or a stray comma.
Things to keep in mind
The tool only fixes syntax errors — it won't catch a broken data structure (a missing field, swapped values), since that kind of JSON is still syntactically valid.
If the damage is severe enough (a string cut off mid-way, for example), the automatic fix can produce an unexpected result — always check the output before using it.
Articolo su questo strumento: JSON Repair: perché il JSON si rompe e come ripararlo
Domande frequenti
Che tipo di problemi può correggere questo strumento?
Corregge JSON malformato: virgole finali, apici singoli al posto delle doppie virgolette, chiavi non tra virgolette, commenti, letterali Python come True/False/None convertiti in true/false/null, virgole o due punti mancanti e stringhe, oggetti o array non chiusi, elencando ogni correzione applicata.
Lo strumento riesce sempre a riparare un JSON rotto?
Non sempre: se i dati sono fondamentalmente ambigui o mancanti in modo grave, ad esempio un input troncato in modo severo, non esiste una correzione univoca e corretta possibile.
Il JSON da riparare viene caricato su un server?
No, la riparazione avviene interamente nel browser con JavaScript.
Cosa fare se il risultato della riparazione sembra sbagliato?
Verifica sempre il risultato manualmente, soprattutto nei punti di troncamento. La correzione automatica fa l'ipotesi "meno distruttiva" (ad esempio chiude semplicemente le parentesi aperte), ma non può indovinare quale valore fosse previsto se i dati sono danneggiati in modo serio.
Lo strumento corregge anche gli errori logici nei dati?
No, solo quelli sintattici. Se nei dati manca un intero campo o un valore è scambiato di posto (ma il JSON è sintatticamente corretto), lo strumento non se ne accorge — non è un errore di sintassi.