LLM JSON Repair
A chat model that was asked for JSON still sometimes replies with a friendly sentence, a Markdown code fence or a stray trailing comma, and a strict parser then rejects it. This tool cleans up those common, well-defined problems in your browser: it removes fences, extracts a single JSON value from surrounding prose, drops trailing commas and converts curly-quoted strings. It reports each change, refuses ambiguous input, and never executes the text it reads. Parsing is done by the browser's own JSON parser, so a green status means the output is valid JSON.
Your workspace
Runs locally in your browserResult
Your input is processed locally in your browser and is not sent to Flutters servers. Inputs are not saved by this tool.
How to use this tool
Paste the model's reply, choose Repair JSON, then check the status and the repair summary. Copy the repaired JSON or clear the page.
Example
Input
Here is the data:
```json
{"name": "Ada", "tags": ["dev",],}
```Output
{
"name": "Ada",
"tags": [
"dev"
]
}What does this tool do?
Language models often wrap JSON in Markdown fences, add a sentence before or after it, leave a trailing comma or use curly quotation marks. This tool applies a small set of deterministic fixes for those cases, validates the result with a real JSON parser and lists what it changed. Ambiguous damage is rejected instead of guessed.
Common mistakes and limitations
Only deterministic problems are fixed. Truncated output, missing quotes, single-quoted strings, comments, unquoted keys and replies containing several JSON values are reported as errors, because any fix would be a guess that could silently change your data. Always validate repaired data against a schema before using it.
The problems models commonly produce
Chat models are trained to be helpful in prose, so a JSON reply often arrives inside a Markdown fence, after an introductory sentence, or with a trailing comma left after the last item. Some also use curly quotation marks copied from typeset text. A strict parser rejects each of these, even though a person can see the intended data. The fixes here target exactly those well-defined cases.
```json
{"items": [1, 2,],}
```
-> {"items": [1, 2]}Why it refuses to guess
Repairing truncated output, adding missing quotes or turning single quotes into double quotes can change what the data means, and a model that is wrong in one place is not reliably right in another. When the tool cannot be certain, it reports the parser error so you can regenerate or edit manually. Repaired JSON is syntactically valid, which is not the same as correct, so validate it against a schema.
Related: JSON to JSON Schema, JSON Formatter
Fewer repairs in the first place
Ask for JSON only, give an example of the exact shape and, where your provider supports it, use a structured-output mode with a schema. Keep a parser and a retry path in your application. Once the data is valid, format or minify it, or generate Dart models from it.
Related: JSON Minifier, JSON to Dart
Frequently asked questions
Does it use eval or an AI model?
No. It uses string scanning and the browser's built-in JSON parser. Nothing is executed and nothing is sent to a server.
Can it fix truncated JSON?
No. Closing brackets for a truncated reply would invent data. Ask the model to continue or regenerate the response.
How do I prevent invalid JSON in the first place?
Use your provider's structured-output or JSON mode with a schema where available, and still validate the result in your application.
Related tools
JSON Formatter & Validator
Format and validate JSON with readable indentation.
Open tool Developer ToolsJSON Minifier
Remove unnecessary whitespace from valid JSON.
Open tool AI & LLM ToolsJSON to JSON Schema Generator
Generate a draft JSON Schema from a sample JSON document, with nested objects, arrays and an optional required-fields toggle.
Open tool Flutter & Dart ToolsJSON to Dart Converter
Generate null-safe Dart models from a JSON object.
Open tool