JSON Repair
Automatically fix malformed JSON with intelligent repair algorithms.
Overview
The JSON repair feature can automatically fix common JSON syntax errors. This is especially useful when working with JSON from logs, APIs that return malformed data, or hand-edited configuration files.
You can also access repair from the Tools menu or the right-click context menu.
What Can Be Repaired
Trailing Commas
Removes trailing commas in objects and arrays that cause parse errors.
{"name": "John",} {"name": "John"} Unquoted Keys
Adds quotes around object keys that are missing them.
{name: "John"} {"name": "John"} Single Quotes
Converts single quotes to double quotes (JSON standard).
{'name': 'John'} {"name": "John"} Comments
Removes JavaScript-style comments that are not valid in JSON.
{"name": "John" // user name} {"name": "John"} Special Values
Converts undefined, NaN, and Infinity to null.
{"value": undefined} {"value": null} Duplicate Commas
Removes consecutive commas that cause parse errors.
[1,, 2,,, 3] [1, 2, 3] Semicolons
Replaces semicolons used as separators with commas.
{"a": 1; "b": 2} {"a": 1, "b": 2} Escape & Unescape
The repair feature also handles string escaping issues:
- Unescaped control characters - Escapes newlines, tabs, and other control characters in strings
- Double-escaped strings - Fixes over-escaped JSON like \\n becoming \n
- Unicode escapes - Properly handles \uXXXX escape sequences
Repair Report
After repairing, Pandia shows a report of what was fixed:
- Success status - Whether the JSON was successfully repaired
- Warnings - Non-critical issues that were fixed
- Errors - Issues that could not be automatically fixed
- Size comparison - Original vs repaired content length