JSON 修复
自动修复常见 JSON 错误
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.
相关工具
常见问题
可修复常见问题:缺少闭合的 ]/}、尾随逗号、用单引号代替双引号、属性名未加引号、缺少逗号、注释(// 和 /* */)、以及被截断的 JSON。很多情况下能从部分损坏的输入中重建出合法 JSON。
工具使用能识别常见 JSON 错误的解析器,逐字符读取输入,定位结构性问题,并做“最小改动”来生成合法 JSON,同时尽量保留你的原始数据。
很多情况下可以。如果 JSON 在中途被截断(例如网络超时),工具会尝试补全未闭合的字符串、数组和对象,让它变成合法 JSON。当然,被截断掉的那部分数据本身会丢失。
只做让 JSON 合法所必需的最小改动,尽量保留原有的值、key 和结构。工具也会列出具体做了哪些修复,方便你逐项确认。