Fix broken JSON from AI models

Paste JSON that will not parse. The fixer removes code fences, trailing commas, comments and single quotes, closes cut-off brackets, and formats the result.

Free, no sign-up. Runs in your browser, nothing is uploaded.

Repaired 7 kinds of problems:

  • Removed the markdown code fence
  • Quoted unquoted keys
  • Changed single quotes to double quotes
  • Removed trailing commas
  • Converted Python True/False/None
  • Removed comments
  • Closed brackets left open by a cut-off response

How to use it

  1. 1

    Paste the broken JSON, including any text or ``` fences around it.

  2. 2

    The fixer repairs it and shows every change it made.

  3. 3

    Copy the formatted or minified JSON, or read the exact error if something cannot be fixed automatically.

Why LLMs return broken JSON

Language models write JSON one token at a time and learned it from code that is not always strict JSON. Typical slips: wrapping the answer in ``json fences, adding a sentence before it, leaving a trailing comma, using single quotes or Python's True and None, adding //` comments, or stopping mid-object when they hit the output limit.

Any of these makes JSON.parse fail, and with it your n8n flow, script or integration. The fixer handles all of them, and lists the repairs so you can see what the model got wrong.

Prevent it at the source

Most current models support structured outputs, where the API guarantees valid JSON that matches a schema. The model pages on our AI model pricing table show which models support it. Raising max_tokens prevents cut-off objects.

Frequently asked questions

  • Paste the JSON here. The error usually comes from a trailing comma, single quotes, a comment or text around the JSON; the fixer repairs these and shows the position of anything it cannot fix.

  • It closes open brackets and braces so the remaining data parses. A value cut off mid-string may still need a check.

  • Yes. If the input is already valid, it simply formats it and says no fixes were needed.

  • No. Repair and validation run entirely in your browser.

Your team, every AI model, one workspace

Intrascope gives employees GPT, Claude, Gemini and 120+ models with shared company context, budgets per user and team, and exports to PDF, DOCX and PPTX. 7-day free trial.