Free · Private · Runs in your browser

Mend broken JSON in seconds

Paste the mangled output from an AI model, a log file or a Python script. JSONMender stitches it back into valid JSON, then shows you the original error and every fix it made.

Indent
Broken JSON Paste, type or drop a file
Mended JSON
Waiting for input Paste something broken on the left, or load the broken sample.

What JSONMender can mend

The repair works in two passes. First it reads your text the way a forgiving parser would and notes every problem it finds, with its line and column. Then it rebuilds the text as strict JSON (using the open-source jsonrepair library for the structural work) and checks the result with a strict parser before showing it.

  • AI and chat output: Markdown ```json fences, explanations before or after the JSON, and responses cut off mid-string or mid-array.
  • JavaScript literals: comments, trailing commas, unquoted keys, single quotes, backticks, undefined, NaN, hex numbers and const data = …; wrappers.
  • Python reprs: True, False, None, single-quoted strings with apostrophes, tuples, u'' prefixes and Decimal('1.50').
  • Logs and streams: NDJSON, JSON payloads inside timestamped log lines, values glued together, and JSONP callbacks.
  • Copy-paste damage: curly “smart” quotes, invisible non-breaking spaces and byte-order marks, missing commas and quotes, and JSON that was escaped or stored inside a string.

How to use it

  1. Paste your text into Broken JSON, drop a file onto it, or use Open file.
  2. The mended result appears on the right straight away (larger files: press Mend JSON).
  3. Read What was wrong for the original error, and What was mended for each fix. Click a line reference to jump to it.
  4. Pick the indentation, optionally sort keys, then copy or download the result.

Need a stricter look? The JSON validator explains a single error in detail, and the JSON viewer lets you browse the repaired data as a tree.

More tools in the workshop

All of them run locally, just like the repair tool.

Recommended

Two free services that pair well with debugging JSON.

For debugging APIs

WebTraceCheck

When a broken response comes from an endpoint you do not control, look at it from the outside. WebTraceCheck runs a disposable cloud browser (Chrome, Firefox, Edge, Brave or Chromium on an isolated Linux desktop that is deleted after each session) and offers free DNS, IP, redirect-chain and security-header checks.

For testing sign-ups

CleanTempMail

Testing a flow that sends a confirmation email? CleanTempMail gives you an instant disposable inbox with no sign-up, and emails are deleted automatically after 3 days. Its Temp Mail API lets automated tests receive verification emails too.

Frequently asked questions

Is my JSON uploaded anywhere?

No. The repair runs entirely in your browser with JavaScript. Your text is never sent to a server, and once the page has loaded it keeps working without a network connection.

How does it handle truncated output from ChatGPT or other AI models?

When a response stops mid-way, JSONMender closes the open string, fills a dangling property with null and adds the missing closing brackets, then tells you exactly what it added. It cannot recover data that was never generated, so check the last item of the output.

Will repairing change my data?

Only the syntax is changed. Numbers keep their exact digits (large IDs are not rounded), and key order is preserved unless you tick Sort keys. A few values have no JSON equivalent: NaN, Infinity and undefined become null, and numbers with leading zeros such as 007 are kept as strings. The Changes panel shows every edit.

Why does JSON reject trailing commas and comments?

The JSON standard (RFC 8259) is deliberately minimal so that every parser behaves the same way. Formats such as JSON5 and JSONC allow comments and trailing commas, which is why they appear in config files, but APIs and JSON.parse expect strict JSON.

How large a file can I repair?

Files of several megabytes work fine; the limit is your device's memory. Input up to 512 KB is repaired as you type. For bigger input, press Mend JSON.