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.

Cmd/Ctrl + Shift + R Repair current JSON

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.

Before {"name": "John",}
After {"name": "John"}

Unquoted Keys

Adds quotes around object keys that are missing them.

Before {name: "John"}
After {"name": "John"}

Single Quotes

Converts single quotes to double quotes (JSON standard).

Before {'name': 'John'}
After {"name": "John"}

Comments

Removes JavaScript-style comments that are not valid in JSON.

Before {"name": "John" // user name}
After {"name": "John"}

Special Values

Converts undefined, NaN, and Infinity to null.

Before {"value": undefined}
After {"value": null}

Duplicate Commas

Removes consecutive commas that cause parse errors.

Before [1,, 2,,, 3]
After [1, 2, 3]

Semicolons

Replaces semicolons used as separators with commas.

Before {"a": 1; "b": 2}
After {"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