JSON
JSON Repair
Reparación de JSON dañado — comas sobrantes, comillas simples, claves sin comillas, comentarios, literales de Python (True/False/None) y más — con una lista de todas las correcciones aplicadas.
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.
Artículo sobre esta herramienta: JSON Repair: por qué se rompe el JSON y cómo arreglarlo
Preguntas frecuentes
¿Qué tipos de errores puede corregir la herramienta?
Comas sobrantes, comillas simples en lugar de dobles, claves sin comillas, comentarios no permitidos en JSON, literales de Python como True/False/None, y comas o dos puntos faltantes, entre otros.
¿Puede la herramienta reparar cualquier JSON dañado?
No, con una entrada muy dañada, por ejemplo texto truncado en mitad de un valor, a veces no existe una única reparación inequívoca, así que los datos originales podrían no recuperarse con certeza.
¿La herramienta ve o envía el JSON que pego a algún sitio?
No, toda la reparación se realiza localmente en tu navegador mediante JavaScript, no se sube ningún contenido a ningún servidor.
¿Qué hacer si el resultado de la reparación parece incorrecto?
Revisa siempre el resultado manualmente, sobre todo en los puntos de corte. La corrección automática hace la suposición «menos destructiva» (por ejemplo, simplemente cierra los corchetes abiertos), pero no puede adivinar qué valor se pretendía si los datos están gravemente dañados.
¿La herramienta corrige errores lógicos en los datos?
No, solo sintácticos. Si falta un campo entero o un valor está intercambiado por otro (pero el JSON en sí es sintácticamente correcto), la herramienta no lo detectará — eso no es un error de sintaxis.