JSON Repair

Paste broken JSON — for example output copied from an AI chat — and get back valid, pretty-printed JSON plus a list of every fix that was applied.

Broken JSON


Repaired JSON

Enter JSON above and click Repair JSON.
Runs locally in your browser. Nothing is uploaded.

What is JSON Repair?

JSON Repair fixes JSON text that is almost valid but fails to parse. AI chatbots and language models often produce output that looks like JSON yet breaks strict parsers: trailing commas after the last item, single quotes instead of double quotes, object keys without quotes, comments, or a sentence pasted after the closing brace. Each of these small defects makes JSON.parse throw, even though a human can see exactly what the data was meant to be.

This tool repairs the most common defects automatically. It first removes any text after the end of the JSON value, then strips // and /* */ comments, converts single-quoted strings to double-quoted strings, adds quotes around bare object keys, and removes trailing commas before } or ]. After those repairs it parses the result with a standard JSON parser, so what you copy out is guaranteed valid JSON. Every fix is listed under the output, so you can see exactly what changed and nothing is silently rewritten.

How to use JSON Repair

1. Paste the broken JSON into the input box, or click Load example to try a sample. 2. Click Repair JSON. 3. Copy the pretty-printed result from the output box, and check the fixes list to confirm the changes look right. 4. If the input still cannot be repaired, the tool shows the parser error message so you know what remains wrong.

Frequently asked questions

Will it change my data values? No. The repair steps only touch syntax — quotes, commas, comments, and surrounding text. Numbers, strings, and structure pass through unchanged, and the fixes list shows every syntactic change made.

Why does AI output so often need repair? Language models imitate the look of JSON without enforcing its grammar, and they commonly borrow JavaScript habits such as trailing commas and single-quoted strings. They also add explanations before or after the data. This tool is built for exactly that pattern.

What if the JSON is too broken to repair? The tool reports the parser error instead of guessing. Deeply broken input — mismatched braces, missing values, or truncated text — cannot be repaired safely, and inventing missing data would be worse than failing clearly.

Is my JSON sent anywhere? No. All repair and parsing happens in your browser. Nothing is uploaded to any server.

Related tools

JSON Diff · JSON Formatter · JSON to CSV · Text Diff

Runs locally in your browser. Nothing is uploaded. How our privacy works

© 2026 TinyLabTools · tinylabtools.com