Description
json_repair is a Python library that repairs malformed JSON, such as the output of LLMs, API responses, logs and user input. It fixes missing quotes, commas, brackets and comments, stray prose around the data, and truncated values. It can be used as a drop-in fallback for json.loads(), or as a schema-guided repair step in a pipeline. The library handles Python-style tuples, turning parenthesized sequences into JSON arrays, and it recognizes true, false, null and None case-insensitively inside arrays, objects and tuples. For incomplete arrays and objects, it adds missing commas, brackets or default values such as null or an empty string, so the result is valid JSON while the content is kept. The README explains why the library exists: language models sometimes skip a parenthesis or add words inside their JSON output, and the author wanted a lightweight package that fixes that without destroying the content. You install it with pip install json-repair. The project has a live demo for checking your own JSON online. It is open source on GitHub, and the author asks for sponsorship because it is maintained as a side project.…
Highlights
- Repairs JSON from LLMs, APIs, logs and user input
- Fixes missing quotes, commas, brackets and comments
- Drop-in fallback for json.loads()
- Completes truncated values with defaults
- Live demo in the browser
Ratings & Reviews
No ratings yet
Be the first to rate Json Repair.
People also visit
Svelte Jsoneditor
A web-based tool to view, edit, format, repair, query, transform
Json Repair FAQ
What does json_repair do?
It takes malformed JSON and returns valid JSON, keeping the content where possible.
How do I install it?
Run pip install json-repair.
Can I use it instead of json.loads?
Yes. The README describes it as a drop-in fallback for json.loads(), and also as a schema-guided repair step.
What kinds of errors does it fix?
Missing quotes, misplaced commas, unescaped characters, missing brackets, comments, stray prose and truncated values.
Can I try it without installing?
Yes. The README links a live demo where you can validate or repair your JSON online.
Is it free?
Yes. It is open source and the code is on GitHub. The author asks for sponsorship if it helps your work.
What are the best Json Repair alternatives?
Popular alternatives to Json Repair include JSONFix, Partial Json Parser and Partial Json Parser JS. See all Json Repair alternatives

.png?auto=compress&fit=max&w=128)






.png?auto=compress&fit=max&w=128)