Left — Broken JSON
Right — Repaired JSON
Privacy: Repair runs locally in your browser. No JSON is uploaded.
Tip: If the input is already valid, the tool simply re-formats it — your data is never changed.
Ready. Paste broken JSON on the left, then click Repair.

JSON Repair — Fix Broken & Invalid JSON Online

Paste malformed JSON and this free JSON repair tool fixes the most common problems — trailing commas, single or smart quotes, unquoted keys, missing commas or brackets, comments, and Python-style True/False/None — then returns clean, valid, formatted JSON. Everything runs locally in your browser, and valid JSON is never altered.

Broken JSON is one of the most common problems developers hit: a config file with a trailing comma, an API payload copied from a log with single quotes, a Python dictionary pasted in place of JSON, or a snippet that was cut off before its closing bracket. This JSON repair tool fixes those issues automatically and gives you valid JSON you can actually use.

What this JSON repair tool fixes

The repairer handles the errors that account for the vast majority of invalid JSON in the wild:

  • Trailing commas — removes the extra comma in [1, 2, 3,] or {"a": 1,}.
  • Single and smart quotes — converts 'key' and curly “key” to standard double quotes.
  • Unquoted keys — adds the missing quotes in {name: "Ava"}.
  • Missing commas — inserts separators between values that run together.
  • Unclosed brackets and braces — closes truncated objects and arrays.
  • Comments — strips // line comments and /* … */ block comments, which JSON does not allow.
  • Python and JavaScript literals — normalizes True, False, None, NaN, and Infinity to valid JSON.
  • Invalid escapes and a stray BOM — cleans up bad escape sequences and a leading byte-order mark.

Every fix that gets applied is listed under the editor, so you can see exactly what changed. The output is validated before it is shown — if the input truly cannot be recovered, you get an honest error instead of silently broken JSON.

How to fix broken JSON

  1. Paste your broken or invalid JSON into the left editor (or click Load Sample to try a broken example).
  2. Click Repair, or leave Auto run on to fix as you type.
  3. Review the fixes applied chips to see what was changed.
  4. Copy or download the valid, formatted JSON from the right editor.

Before and after examples

Example 1: trailing commas and unquoted keys

Input:

{
  name: "Ava",
  roles: ["admin", "editor",],
}

Repaired:

{
  "name": "Ava",
  "roles": ["admin", "editor"]
}

Example 2: a Python dictionary

Input:

{'name': 'Ava', 'active': True, 'note': None}

Repaired:

{
  "name": "Ava",
  "active": true,
  "note": null
}

Example 3: truncated / unclosed JSON

Input:

{ "id": 7, "items": [1, 2, 3

Repaired:

{
  "id": 7,
  "items": [1, 2, 3]
}

Why JSON breaks

JSON has a strict grammar, so small habits from other formats often make it invalid. Trailing commas are legal in JavaScript and Python but not in JSON. Single quotes are fine in JavaScript strings but JSON requires double quotes. Comments are common in config files but the JSON spec has none. Copy-pasting from logs, terminals, or chat can also introduce smart quotes, escaped fragments, or truncation. A repair tool bridges that gap so you can move on quickly.

If you only need to confirm whether JSON is valid and see the exact error line, use the JSON Validator. To pretty-print or minify already-valid JSON, use the JSON Formatter. To turn a stringified or escaped payload back into JSON, use JSON Parse.

FAQs

Will it change my valid JSON?
No. If the input is already valid, the tool only re-formats it and never alters the data.

Is the repaired output always valid?
Yes. The result is parsed and validated before it is displayed. If the input cannot be recovered into JSON, the tool reports an error rather than showing broken output.

Does it fix Python dictionaries?
Yes. It converts single quotes to double quotes and normalizes True, False, and None to true, false, and null.

Can it repair truncated JSON?
It closes unclosed objects, arrays, and strings so you get a valid structure back. Data that was cut off cannot be invented, but the remaining JSON is recovered.

Is my data uploaded?
No. Everything runs locally in your browser.