Repaired JSON will appear here...
Common JSON Errors This Tool Fixes:
LLM/AI Output Fixes:
Related Tutorials
What is JSON Repair?
JSON Repair automatically fixes common syntax errors in JSON data, including errors specific to LLM/AI output. Many developers accidentally write invalid JSON - using single quotes, forgetting quotes around keys, leaving trailing commas, or adding comments. AI tools like ChatGPT and Claude can also produce malformed JSON with markdown wrappers, Python-style booleans, truncated output, and more. This tool detects and fixes all these issues, transforming invalid JSON into valid, parseable data.
How to Use
- Paste your invalid or broken JSON into the input field.
- Click 'Repair JSON' to automatically fix common errors.
- Review the repair actions list to see what was fixed.
- Check the repaired output - if still invalid, manual editing may be needed.
- Copy the repaired JSON and use it in your application.
- Use 'Load Sample' to see examples of common errors and how they're fixed.
- Use 'Load LLM Sample' to see AI-specific errors like markdown wrappers, Python booleans, and truncated output.
Why Use This Tool?
Tips & Best Practices
- Load Sample to see common error patterns and how they're fixed
- Load LLM Sample to see AI-specific errors like ```json wrappers and Python-style values
- If repair can't fix all errors, the remaining error message helps identify what's wrong
- Use JSON Validator after repair to double-check the result
- Complex structural errors may require manual fixing
- Comments are removed because JSON doesn't support them
- When truncated JSON is detected, a warning will appear - the data may be incomplete
Frequently Asked Questions
What types of errors can this tool fix?
This tool fixes: single quotes → double quotes, unquoted keys → quoted keys, trailing commas → removed, JavaScript comments → removed, NaN/Infinity → null, undefined → null. It also fixes LLM/AI-specific issues: markdown code wrappers (```json), Python-style booleans (True/False), Python None, unquoted string values, hexadecimal numbers, whitespace in values, multiple JSON objects, and truncated output.
How does it fix LLM/AI output?
LLMs like ChatGPT and Claude often produce JSON with specific issues: wrapping output in ```json code blocks, using Python-style True/False/None instead of true/false/null, leaving string values unquoted, outputting hexadecimal numbers, and truncating responses mid-JSON. This tool detects and fixes all these patterns automatically.
Why are single quotes invalid in JSON?
JSON specification requires all strings (both keys and values) to use double quotes. Single quotes are JavaScript syntax but not valid JSON. This tool converts 'text' to "text" automatically.
What happens with truncated JSON?
When LLM output is cut off mid-response, the tool counts open brackets and braces, then adds the missing closing characters. A warning appears to let you know the JSON was truncated - while the result is parseable, some data may be incomplete.
What if the JSON can't be fully repaired?
Some errors require manual fixing, like mismatched brackets, incorrect nesting, or complex structural issues. When automatic repair can't fully fix the JSON, the tool shows what it fixed and the remaining error message to help you fix manually.
Can I repair large JSON files?
Yes, the tool handles JSON files of any size that fit in your browser's memory. For very large files (many MB), the repair process may take a few seconds but works the same way.
Is my JSON data secure?
Absolutely. All repair operations happen in your browser using JavaScript. Your data is never sent to any server, never stored, and never logged. Close the page and all data is cleared.
Should I use this for production data?
This tool is great for debugging and fixing JSON quickly. For production systems, always validate your JSON generation code to prevent these errors at the source. Use JSON Validator to double-check repaired data before using it.