kaptinlin/jsonrepair
A high-performance Golang library for easily repairing invalid JSON documents. Designed to fix common JSON issues and optimize JSON content generated by language models (LLMs).
This library helps Go developers clean up malformed JSON data, especially content generated by large language models. You provide a messy JSON string, and it returns a valid, corrected JSON string. It's for Go application developers who need to process user input or external data streams that might contain common JSON errors.
Use this if you are a Go developer building applications that consume JSON from untrusted sources like LLMs, APIs, or user input, and need to automatically fix common formatting errors.
Not ideal if you need to strictly validate JSON without attempting any repair, or if you are not working in the Go programming language.
Stars
94
Forks
9
Language
Go
License
MIT
Category
Last pushed
Feb 28, 2026
Commits (30d)
0
Get this data via API
curl "https://pt-edge.onrender.com/api/v1/quality/llm-tools/kaptinlin/jsonrepair"
Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.
Compare
Higher-rated alternatives
mangiucugna/json_repair
A python module to repair invalid JSON from LLMs
antfu/shiki-stream
Streaming highlighting with Shiki. Useful for highlighting text streams like LLM outputs.
yokingma/fetch-sse
An easy API for making Event Source requests, with all the features of fetch(), Supports...
iw4p/partialjson
+1M Downloads! Repair invalid LLM JSON, commonly used to parse the output of LLMs — Parsing...
HAibiiin/json-repair
Repair JSON! A Java library for fixing JSON anomalies generated by LLMs.