JSON Fixer Online: Repair Broken JSON from ChatGPT & Claude
Paste broken JSON from an AI model, an API or a config file. This free JSON fixer strips markdown fences, fixes missing quotes and trailing commas, and outputs valid, formatted JSON. It runs in your browser, so your JSON is not uploaded to our servers.
- Strips markdown fences
- Fixes trailing commas
- No upload, no sign-up
- Runs in your browser
- No upload
- No sign-up
- Strips markdown
- Free forever
How to fix broken JSON in 3 steps
- 1
Paste broken JSON
Paste the raw output from ChatGPT, Claude or an API, including any markdown backticks or explanatory text.
- 2
Automatic repair
The engine extracts the JSON payload and fixes missing quotes, trailing commas, and unquoted keys.
- 3
Copy clean JSON
View the formatted JSON with 2-space indentation and copy it with one click.
Common JSON errors this fixer repairs
Most “invalid JSON” and “Unexpected token” errors come from a handful of mistakes. Here is what each one looks like and how it is fixed.
Trailing comma
JSON does not allow a comma after the last item in an object or array.
Broken
{"name": "Ana", "age": 30,}Fixed
{"name": "Ana", "age": 30}Single quotes
JSON requires double quotes around keys and string values.
Broken
{'name': 'Ana'}Fixed
{"name": "Ana"}Unquoted keys
Every key must be a double-quoted string.
Broken
{name: "Ana"}Fixed
{"name": "Ana"}Python True/False/None
JSON uses lowercase true, false and null.
Broken
{"active": True, "x": None}Fixed
{"active": true, "x": null}Comments
Standard JSON has no comments, so they must be removed.
Broken
{"a": 1 // note }Fixed
{"a": 1}Markdown code fence
Chat tools wrap JSON in backticks. Those characters are not part of the JSON.
Broken
```json {"a": 1} ```Fixed
{"a": 1}
Everything you get in this free JSON repair tool
Strips Markdown Fences
ChatGPT often wraps JSON in ```json blocks. The tool strips the markdown and extracts the raw object or array.
Fixes Trailing Commas
A common LLM mistake is leaving a comma after the last item. The repair engine removes it automatically.
Adds Missing Quotes
If a key or value is missing its quotes, or uses single quotes, the tool repairs it into valid double-quoted JSON.
Python Literals
Got True, False or None from Python output? They are converted to valid JSON true, false and null.
Instant, Local Repair
The repair runs in your browser, so there are no loading spinners and no API calls for your data.
JSON Formatter Built In
The output is beautified with clean 2-space indentation, ready to paste into your code, Postman or config file.
What people use this JSON fixer for
Fixing ChatGPT and Claude JSON
Language models sometimes produce invalid syntax. Paste the broken block here to get valid JSON instantly.
Cleaning API payloads
Quickly repair malformed JSON responses before testing them in Postman or your code.
NoSQL data prep
Check that MongoDB or Firestore documents are valid before importing them.
Config file debugging
Fix a broken package.json or tsconfig.json without hunting for the missing comma.
No-code automations
When Zapier or Make throws an error, validate and repair your webhook payloads here.
Learning JSON syntax
Compare the broken and fixed versions to see exactly what was invalid.
How this JSON fixer compares to validators and formatters
Most JSON validators only tell you the data is invalid. This tool actively repairs common LLM and API mistakes.
| Feature | TToolDeck | Online validators | Standard formatters |
|---|---|---|---|
| Runs entirely in your browser | Yes | No | No |
| JSON never sent to a server | Yes | No | No |
| Strips markdown code fences | Yes | No | No |
| Fixes trailing commas | Yes | Yes | Yes |
| Formats with 2-space indent | Yes | Yes | No |
| Free without paywalls | Yes | No | Partial |
Comparison reflects general trends at the time of writing. Features of other tools may change.
JSON fixer FAQ
How do I fix broken JSON?
Paste it into the box above. The tool repairs common syntax errors such as trailing commas, missing or single quotes, unquoted keys, comments and markdown fences, then outputs valid, formatted JSON you can copy.
Why does ChatGPT return invalid JSON?
Language models generate text token by token, so they can add markdown fences, explanatory text, trailing commas or unescaped characters, or get cut off before closing a bracket. A JSON fixer cleans these mistakes up.
Does this fix markdown code blocks?
Yes. If you copy a response that includes ```json ... ``` fences and surrounding text, the tool extracts the JSON, strips the markdown, and repairs it.
What kind of JSON errors can it fix?
It fixes trailing commas, missing quotes, single quotes instead of double quotes, unquoted keys, Python-style True/False/None and JavaScript-style comments.
How do I fix "Unexpected token" in JSON?
This error means the parser hit a character it did not expect, such as a backtick, a trailing comma, a single quote or text before the opening brace. Paste your data here to see and fix the problem automatically.
Is my data sent to a server?
No. The repair engine runs in your browser using JavaScript. Your JSON is not uploaded to our servers.
Does it handle nested objects and arrays?
Yes. It parses and repairs deeply nested JSON structures and arrays.
What if the JSON is too broken to repair?
If the structure is corrupted beyond repair, the tool shows an error so you can adjust the input manually. Truncated output may need to be regenerated.
Does it also format and beautify JSON?
Yes. The output is valid JSON with 2-space indentation, ready to paste into your codebase.
Is there a file size limit?
Since it runs locally, you are limited only by your browser's memory. Large JSON files may take a moment to process.
Can I use this commercially?
Yes. The tool is free and the output has no watermark or attribution requirement.
More free AI and developer tools
Free tools that run in your browser.