Free online tools to generate, calculate,
convert, format, encode, and play.
 

JSON Repair Tool

Paste broken or malformed JSON from LLM output, logs, or APIs; this tool auto-fixes trailing commas, single quotes, unquoted keys, comments, missing brackets and more, then shows a diff of exactly what changed. Everything runs in your browser.


Broken JSON


How It Works

JSON produced by large language models, copied out of logs, or returned by loose APIs is often almost valid but rejected by strict parsers. This tool re-tokenizes the text and rewrites it into strict, JSON.parse-compatible output while recording every change.

Problems it fixes
  • Trailing commas[1, 2, 3,] and {"a": 1,}
  • Missing commas between array items and object entries
  • Single & smart quotes'value', “value” become "value"
  • Unquoted keys{name: "Ada"} becomes {"name": "Ada"}
  • Python / JS literalsTrue, False, None, NaN, undefined, Infinity become valid JSON
  • Comments// line and /* block */ comments are stripped
  • Markdown fences — surrounding ```json fences and prose are removed
  • Missing brackets — unbalanced { } and [ ] are closed
  • Number quirks.5, 5., leading +, and leading zeros
  • Control characters — raw newlines and tabs inside strings are escaped
  • Newline-delimited JSON — multiple top-level values are wrapped in an array
Steps
  1. Paste your broken JSON into the input box.
  2. The repaired result appears automatically (or click Repair JSON).
  3. Review the What Was Fixed list and the line-by-line Diff.
  4. Copy or download the clean, valid JSON.
Private: All parsing happens locally in your browser. Your JSON is never uploaded to a server.

Embed This Util

You can embed this util on your own site as a widget. Adding ?embed=1 to the URL loads a compact version with just the tool itself; no header, menu, or documentation. Paste this snippet into your HTML:


    

Copy snippet Adjust the height to taste.



Feedback

Help us improve this page by providing feedback, and include your name/email if you want us to reach back. Thank you in advance.


Share with