JSON Repair
Broken JSON
Loading editor…
Repaired JSON
Loading editor…

JSON Repair

Paste broken or malformed JSON and get valid, formatted JSON back. Handles trailing commas, single quotes, unquoted keys, missing brackets, Python literals, comments, and more.

Auto-repair
Fixes the most common JSON errors automatically.
Many cases
Trailing commas, unquoted keys, Python booleans, comments, and more.
Formats output
Repaired JSON is pretty-printed with 2-space indentation.
Client-side
No data is uploaded. Everything runs in your browser.

What JSON Repair Fixes

ProblemExampleFixed
Trailing comma in object{"a":1,"b":2,}{"a":1,"b":2}
Trailing comma in array[1,2,3,][1,2,3]
Single-quoted strings{'name':'Alice'}{"name":"Alice"}
Unquoted keys{name: "Alice"}{"name":"Alice"}
Python booleans{"active": True}{"active": true}
Python null{"data": None}{"data": null}
Inline comments{"a":1 // comment}{"a":1}
Block comments{"a": /* note */ 1}{"a":1}
Unclosed brackets{"name":"Alice"{"name":"Alice"}
Missing commas{"a":1 "b":2}{"a":1,"b":2}

Where Broken JSON Comes From

Malformed JSON is surprisingly common in real-world development.

Copying from browser DevTools or logs often picks up extra characters, truncates mid-structure, or includes non-JSON text around the payload. API responses from poorly implemented backends sometimes return JavaScript object literals instead of strict JSON — unquoted keys, single quotes, trailing commas.

Python developers frequently paste data that uses True, False, and None instead of true, false, and null — valid Python but invalid JSON.

Config files like tsconfig.json and VS Code settings.json use JSONC (JSON with Comments), which is rejected by any standard JSON parser. Pasting these files into a tool that expects strict JSON fails immediately.

Manually edited JSON is another common source — a misplaced or forgotten comma after the last item in an array or object is the single most frequent JSON error.

What Repair Cannot Fix

The repairer applies heuristics — educated guesses based on common patterns. Some inputs are too ambiguous to recover cleanly.

If a large chunk of the document is missing, open brackets are closed but the missing data cannot be invented. If brackets are crossed (e.g. {"a": [1, 2}), the output may be structurally valid but not match the original intent. If the input is not JSON-like at all — plain text, HTML, XML — repair will fail or produce nonsense; use the XML to JSON or YAML to JSON tools for those formats.

If you are unsure whether the repaired output matches the original intent, paste both into the JSON Diff tool to see exactly what changed.

Frequently Asked Questions

What kinds of errors can this tool fix?

Trailing commas, single-quoted strings, unquoted keys, missing closing brackets, Python True/False/None literals, inline and block comments, missing commas between items, and concatenated JSON objects.

Can it fix JSON that was cut off mid-string or mid-object?

Yes, in most cases. The repairer will close open strings, objects, and arrays to produce a valid document. The result may be missing data from the truncated portion, but it will be valid JSON.

Will repair change my data?

Only the syntax is changed, not the values. Numbers, strings, booleans, and structure are preserved. If you want to verify nothing unexpected changed, paste both input and output into the JSON Diff tool.

What is the difference between JSON Repair and JSON Formatter?

The formatter requires valid JSON — it will refuse input with syntax errors. The repair tool accepts broken JSON and attempts to fix it first, then formats the result.

Can this fix JSONC or JSON5 files?

Yes. Comments (// and /* */) and trailing commas are both handled, so JSONC files like tsconfig.json and settings.json convert cleanly to strict JSON.

Is my data uploaded anywhere?

No. Repair runs entirely in your browser using the jsonrepair library. Nothing is transmitted.

More Tools