JSON Repair
Fix broken JSON from LLMs, logs and JavaScript objects
Malformed JSON
How to use
- 1.Paste the broken text, upload or drop one .json file, or load an example.
- 2.The output updates as you type; for inputs over 2 MB select Repair JSON to run it.
- 3.Choose 2 spaces, 4 spaces, tabs or compact output.
- 4.Read the repair report and use Show in input to jump to each changed place.
- 5.Copy the result or download it as repaired.json.
What JSON Repair does
JSON Repair turns almost-JSON into strict, parse-valid JSON. It is built for text copied from LLM chats, logs, JavaScript or Python sources and hand-edited files: single quotes, unquoted keys, comments, trailing or missing commas, True/False/None, Markdown code fences with surrounding chat text, and responses that stop mid-way. Repairs come from the deterministic jsonrepair library, and every result is checked with JSON.parse before it is shown.
What the report tells you
The report only lists facts the tool observed: whether a code fence or surrounding prose was removed, whether the input was already valid, how many non-whitespace characters were added or removed, and where each change happened in your input. It never invents a count of "fixes". Valid JSON is only re-indented, and number tokens such as 9007199254740993 or 0.10000000000000000001 are copied exactly, so nothing is rounded.
Limits, review and privacy
Repair is heuristic: a truncated value is closed where the text stops, a missing comma is inserted where it seems most likely, and unquoted text may become a string. Review important data before using it in production. Text that is not JSON-like at all is reported instead of being wrapped into a string, and the change list is skipped above 100 KB to keep the page responsive. Everything runs in your browser; the input is never uploaded.
Frequently asked questions
- What kinds of broken JSON can be repaired?
- Single-quoted strings, unquoted keys, JavaScript comments, trailing commas, many missing commas, Python True/False/None, Markdown code fences with chat text around them and responses that stop in the middle of a value. Text that is not JSON-like at all is reported instead of being wrapped into a string.
- Can I trust the repaired output?
- It is always valid JSON, because every result is checked with JSON.parse before it is shown. The repair itself is heuristic: a cut-off value is closed where the text ends and a missing comma is inserted where it is most likely, so review important data before using it in production. The change list shows each place that was edited.
- Does repairing change numbers or Unicode text?
- No. Number tokens are copied exactly, so values such as 9007199254740993 or 0.10000000000000000001 are not rounded, and non-Latin text and emoji are kept as written. Valid input is only re-indented.
