Third-party toolUpdated 2026.11.15

JSON Repair: Fix LLM JSON Syntax, Then Validate the Data

JSON Repair handles some malformed JSON text, including unquoted keys, single quotes and trailing commas.

Aaron recommends Open official GitHub

JSON Repair handles some malformed JSON text, including unquoted keys, single quotes and trailing commas. This example repairs a synthetic dispatch record and checks an empty input separately. Use the repaired object as input to validation, rather than treating parse success as acceptance.

What the isolated test checked

Compare the complete repaired object: note must be NOTE-31 and hour must be the number 8. Add a separate range check if the application requires an hour from 0 to 23. Syntax repair cannot establish whether a dispatch time is true.

The following is the recorded synthetic output, not a model benchmark.

{
  "input": "{note: 'NOTE-31', hour: 8,}",
  "output": {
    "note": "NOTE-31",
    "hour": 8
  },
  "empty": ""
}

Reproduce the small task

The recorded runtime was Linux with Python 3.12. Installation requires public package downloads; execution was offline. Windows shell behavior was not tested. Use a disposable environment for the example.

python -m pip install json-repair==0.64.9
import sys,json,traceback,importlib.metadata as meta,pathlib,asyncio,subprocess,os
SLUG='json-repair'
def emit(package,checks,observations,**kw):
    print(json.dumps({'checks':checks,'observations':observations},ensure_ascii=False,default=str,indent=2))
def json_repair():
    from json_repair import repair_json
    src="{note: 'NOTE-31', hour: 8,}";r=repair_json(src,return_objects=True);empty=repair_json('',return_objects=True)
    emit('json-repair',dict(fields=r=={'note':'NOTE-31','hour':8},empty=empty==''),dict(input=src,output=r,empty=empty),scope='Syntax repair only. Schema and truth validation remain separate.')
json_repair()

Limits and untested behavior

All malformed formats, very large inputs, streaming mode and field semantics remain untested. A repaired value still needs application validation before triggering an action.

Other capabilities described in the pinned official documentation below were not locally tested. Source availability alone does not establish free hosted execution or free model calls.

Sources and test record

Codex ran the synthetic task in a non-root, network-disabled container without publishing credentials or private inputs. This is not a claim that the site owner personally tested the tool.

Tested package: 0.64.9. Documentation commit: 10d9802ec571. The registry package and README snapshot are separately pinned, not assumed identical. Test date: 2026-11-15.

Related reading

Subscribe to AI tool picks and practical advice

Get worthwhile tool picks, test findings and important updates in your inbox.

Get a monthly-updated list of AI tools and Skills right away. We email when there are worthwhile tool picks, test findings or important updates. Unsubscribe anytime. Privacy

Almost done: check your inboxClick the button in the confirmation email and you will get the download link for the tool list. If you do not see it, check your spam or Promotions folder.

Or follow us on: