JSON Repair
Automatically fix malformed JSON. Repairs common issues like trailing commas, missing quotes, single quotes, and comments.
Input
Output
Supports fixing:
- Trailing commas in arrays and objects
- Missing quotes around property names
- Single quotes instead of double quotes
- JavaScript-style comments (// and /* */)
- Unquoted property keys
What is JSON Repair?
JSON repair automatically fixes common syntax errors in malformed JSON, such as trailing commas, missing or mismatched quotes, single quotes instead of double quotes, JavaScript-style comments, and unquoted property keys. JSONKit's repair tool can often recover data from broken JSON that standard parsers reject.
How to use
- Paste the broken JSON into the input editor.
- Click Repair.
- Review the repaired, valid JSON in the output editor. If the input was already valid, you will be told so.
- Copy the result or continue working with it in the other tools.
Features
- Removes trailing commas and JavaScript-style comments.
- Adds missing quotes around keys and converts single quotes to double quotes.
- Fixes common issues in JSON copied from JavaScript code, logs or LLM output.
- Runs entirely in your browser.
Frequently asked questions
- What kinds of errors can be repaired?
- Trailing commas, comments, single-quoted strings, unquoted property names and similar mistakes that are common when JSON is written by hand or copied from JavaScript. Severely truncated or ambiguous input may not be recoverable.
- Can repair change the meaning of my data?
- The repair only fixes syntax, but when the input is ambiguous it has to make a best guess. Always review the result before using it in production.
- Why does JSON from an AI model or a log fail to parse?
- Output from language models and log lines often contains comments, trailing commas, single quotes or text cut off mid-way. Running it through JSON Repair is usually the fastest way to make it parseable.