JSON Repair
Auto-fix malformed JSON from APIs, AI tools, and copied logs
Broken JSON
Repaired JSON
Recover broken JSON instead of typing fixes by hand
AI tools and APIs don't always produce perfect JSON. Trailing commas, single quotes, comments, unquoted keys, half-truncated objects — every one of those will fail JSON.parse and stop your pipeline. A repair tool reads the broken input character by character and applies the minimum fixes needed to make it valid, preserving your data.
Use the repair tool when you need to
Fix malformed AI model output
Strip Markdown fences, repair single quotes, and close truncated objects so structured output becomes parseable.
Recover a half-broken API response
When a network blip cut a response mid-stream, repair closes open strings, arrays, and objects to salvage what arrived.
Clean up copied JSON from logs or chat
Logs often paste JSON with smart quotes, trailing commas, or extra wrapping — fix it instead of editing line by line.
How to repair JSON quickly
- 1
Paste the broken JSON into the editor.
- 2
Click Repair to apply the minimum fixes for valid syntax.
- 3
Validate the repaired output, then copy or feed it into the next step in your pipeline.
Keep going
Validate after repairing
Confirm the repaired output parses cleanly before feeding it into downstream code.
Repair and schema-validate at once
Combine repair with schema validation for AI model output and tool calls.
Format the result
Pretty-print the repaired JSON to read and review the changes.
Understand parser errors
Learn what each common error message means before deciding to repair.
Common repair workflows
Strip fences and trailing commentary from model output before passing it into a JSON parser.
Close truncated objects and arrays to extract whatever data made it through the wire.
Repair JSON copied from log lines that lost or corrupted some characters in transit.
Related Tools
JSON Validator
Validate API and AI-generated JSON with detailed error messages and line numbers
LLM JSON Output Validator
Repair and validate model JSON output against a schema
JSON Viewer
Explore JSON with interactive tree, table, and raw views
JSON Formatter
Beautify JSON from APIs, AI tools, and logs with configurable indentation
Frequently Asked Questions
The tool fixes missing closing brackets and braces, trailing commas, single quotes instead of double quotes, unquoted property names, missing commas, comments (// and /* */), and truncated JSON. It can often reconstruct valid JSON from partially broken input.
The tool uses a parser that understands common JSON mistakes. It reads the input character by character, identifies structural problems, and applies the minimal fixes needed to produce valid JSON while preserving your original data.
In many cases, yes. If your JSON was cut off mid-stream (like a network timeout), the tool can close open strings, arrays, and objects to produce valid JSON. Some truncated data will obviously be lost.
Often, yes. AI-generated JSON commonly fails because of comments, single quotes, trailing commas, or partial objects. JSON Repair can usually clean those issues up so you can validate the output or pass it into a schema check.
The tool makes minimal changes — only what's needed to make the JSON valid. It preserves all your values, keys, and structure. The fixes applied are listed so you can review exactly what changed.