What the JSON Repair demo does
- Repairs malformed JSON: fixes trailing commas, missing quotes, stray comments, and incomplete objects.
- Validates with JSON Schema: enforce expected types, defaults, and structural constraints when schema guidance is provided.
- Validates and formats: outputs pretty-printed JSON you can copy straight into your code or API calls.
- Transparent logging: see every repair step and context so you can trust the output.
- Built on json_repair, the Python package available on PyPI.
API is hosted on PythonAnywhere’s free tier; if you hit quota, try again later or run the package locally.
How to repair JSON online
- Paste malformed JSON (from webhooks, logs, or LLM responses) into the left box.
- Optionally paste a JSON Schema to validate/coerce fields (for example string-to-integer conversion).
- We validate, repair, and format automatically as you type.
- Copy the valid JSON on the right or review the “repair actions” log for debugging.
JSON Schema validation online
Use the optional JSON Schema input to validate repaired JSON against required properties, value types, and constraints before you copy results into production systems.
- Useful for API contracts, typed pipelines, and AI extraction workflows.
- Supports schema-guided coercion (for example, converting
"1"into1for integer fields). - Keeps behavior transparent with repair logs that show what changed and where.
Why developers use json_repair
- Handles common AI issues: hallucinated text in JSON, wrong booleans/null, broken arrays.
- Drop-in replacement for
json.loads()when you need resilient parsing. - Ideal for webhook payloads, schema-validated pipelines, and prompt engineering workflows.
Prefer code?
Install the package locally and bypass API limits.
pip install json-repair
python -m json_repair
Examples we fix: trailing commas, missing quotes, stray comments, invalid true/false/null, incomplete objects.
Optional. Provide a JSON Schema to guide coercions, defaults, and validation. Leave empty to use normal repair mode.
Schema is optional and included in the page URL so you can share reproducible examples.
FAQ: fixing JSON for production
Does this work for AI/LLM responses?
Yes. json_repair is tuned for messy model output: it removes prose, repairs syntax, and keeps structured data intact.
Can I validate against a JSON Schema here?
Yes. Paste a JSON Schema in the optional schema box to apply schema-guided validation and type coercion while repairing malformed JSON.
Can I trust the repaired JSON?
Every action is logged so you can review context before sending payloads to production systems.
What if I need offline or private processing?
Install the library locally (pip install json-repair) to repair sensitive JSON without hitting the public API.
How do I report issues or request features?
Open an issue on GitHub and include a sample payload; this page URL is a permalink you can reference.