JSON
JSON Repair
ซ่อมแซม JSON ที่เสียหาย — คอมมาเกิน เครื่องหมายคำพูดเดี่ยว คีย์ที่ไม่มีเครื่องหมายคำพูด คอมเมนต์ ลิเทอรัลแบบ Python (True/False/None) และอื่นๆ — พร้อมรายการการแก้ไขทั้งหมดที่ทำ
Data that claims to be JSON often has small deviations from the spec: a trailing comma, single quotes, unquoted keys, Python literals like True/False/None instead of true/false/null. This tool fixes such issues automatically and lists every fix it applied.
How to use it
- Paste broken JSON and the tool immediately tries to fix syntax issues and shows the valid result.
- The list below shows each applied fix separately, so you can check exactly what changed.
- If it can't be repaired (the structure is too damaged), the tool points to the exact line where parsing stopped.
Common uses
- Fixing JSON copied from logs or a console, where strings may have been truncated or escaped incorrectly.
- Converting a Python-style dict (with True/False/None and single quotes) into valid JSON.
- Parsing an LLM response that promised JSON but added a comment or a stray comma.
Things to keep in mind
The tool only fixes syntax errors — it won't catch a broken data structure (a missing field, swapped values), since that kind of JSON is still syntactically valid.
If the damage is severe enough (a string cut off mid-way, for example), the automatic fix can produce an unexpected result — always check the output before using it.
บทความเกี่ยวกับเครื่องมือนี้: JSON Repair: เหตุใด JSON จึงเสียหายและจะแก้ไขอย่างไร
คำถามที่พบบ่อย
เครื่องมือนี้แก้ไขข้อผิดพลาด JSON แบบไหนได้บ้าง?
มันจัดการปัญหาทั่วไป เช่น จุลภาคท้ายรายการ เครื่องหมายคำพูดเดี่ยว คีย์ที่ไม่มีเครื่องหมายคำพูด จุลภาคที่หายไป และวงเล็บที่ไม่ตรงกัน — แต่ไม่สามารถกู้ข้อมูลที่ถูกตัดทอนหรือกำกวมโดยพื้นฐานได้
ทำไม JSON ที่ซ่อมแล้วอาจยังไม่ตรงกับสิ่งที่ฉันตั้งใจไว้แต่แรก?
เครื่องมือซ่อมแซมคาดเดาการแก้ไขที่เป็นไปได้อย่างสมเหตุสมผล แต่เมื่อสตริง JSON เสียหายอย่างรุนแรง โครงสร้างที่ต่างกันหลายแบบอาจอธิบายอินพุตที่เสียหายเดียวกันได้อย่างสมเหตุสมผล — ควรตรวจสอบผลลัพธ์เสมอ
การซ่อม JSON ของฉันส่งมันไปที่ไหนหรือไม่?
ไม่ กระบวนการซ่อมทำงานทั้งหมดในเบราว์เซอร์ของคุณ ไม่มีการส่งข้อมูลไปยังเซิร์ฟเวอร์
ควรทำอย่างไรหากผลลัพธ์ของการซ่อมแซมดูไม่ถูกต้อง?
ควรตรวจสอบผลลัพธ์ด้วยตนเองเสมอ โดยเฉพาะบริเวณที่ข้อมูลขาดตอน การแก้ไขอัตโนมัติจะเดา "แบบทำลายน้อยที่สุด" (เช่น แค่ปิดวงเล็บที่เปิดค้างไว้) แต่ไม่สามารถเดาได้ว่าค่าใดที่ตั้งใจไว้จริง หากข้อมูลเสียหายรุนแรง
เครื่องมือนี้แก้ไขข้อผิดพลาดเชิงตรรกะในข้อมูลด้วยหรือไม่?
ไม่ แก้เฉพาะไวยากรณ์เท่านั้น หากข้อมูลขาดฟิลด์ทั้งฟิลด์ไป หรือค่าสลับตำแหน่งกัน (แต่ JSON ยังถูกต้องตามไวยากรณ์) เครื่องมือจะตรวจไม่พบ — นี่ไม่ใช่ข้อผิดพลาดทางไวยากรณ์