PUBLIC.INTERNET

JSON Repair Tool

This tool takes JSON that a strict parser rejects and applies a short, fixed list of repairs: it strips // and /* */ comments, converts single-quoted strings to double quotes, removes trailing commas, and appends any missing closing braces and brackets. It then parses the result, shows it minified and pretty-printed, and lists what it changed. It handles the common slips in LLM output and hand-edited config, not arbitrary garbage.

How to repair JSON

  1. Paste the broken text into Paste Broken JSON. Input over 200 KB is refused.
  2. Click Repair JSON. If the text already parses, it says no repairs were needed. Otherwise it tries each fix in order and stops as soon as the text parses.
  3. Check the Repairs Made list to see exactly which fixes ran and how many times, then compare the result in the Minified and Formatted boxes.
  4. Click Copy to copy the minified version. Use Validate Only instead if you just want a pass or fail with the parser's error message.

What repair can and cannot guess

Each repair is a pattern match, so it works on text that is nearly valid and nothing more. It will not add quotes to bare keys, insert missing commas between items, close a string that was cut off, or convert values like True, None, or NaN. If the text still fails to parse after the last fix, the tool shows the parser's error message instead of a result.

Two fixes can overreach. The comment remover looks for // anywhere, so a URL such as https://example.com inside a string can be truncated, and the single-quote fix can mangle an apostrophe inside a double-quoted string. Both only run when the original text fails to parse, but always read the repaired output before trusting it. Missing closers are added by counting, not by structure: all } first, then all ]. That closes [{"a":1 correctly, but {"a":[1,2 becomes {"a":[1,2}] and still fails. A cut-off [1,2, fails too, because the trailing-comma fix runs before the closers are added.