JSON Repair Online

Paste not-quite-JSON — code fences, trailing commas, single quotes, Python True/False/None — and get valid, pretty-printed JSON back. Everything runs in your browser.

JSON Repair runs entirely in your browser. The JSON you paste — along with any keys, values, or tokens it contains — is fixed on your device and is never uploaded to ArrayKit.

Open the JSON Formatter

About JSON Repair

JSON Repair takes the not-quite-JSON that language models, logs, and quick hand-edits tend to produce and turns it into valid, pretty-printed JSON. Paste a blob wrapped in ```json code fences, sprinkled with trailing commas, single quotes, unquoted keys, // comments, smart quotes, or Python True/False/None — even one with a missing closing bracket — and get a clean document back. The tool strips the surrounding Markdown fences first, repairs the syntax, then re-parses and re-indents so the result is guaranteed to parse. A short summary shows what was changed — trailing commas removed, single quotes converted, keys quoted — so nothing is fixed silently. It is built for anyone wiring up an LLM pipeline, debugging an API response, or salvaging a truncated payload. Every repair happens locally in your browser; the text you paste never leaves your device.

Features

How to use the JSON Repair

  1. Paste the broken or LLM-generated JSON into the input box
  2. Read the repaired, pretty-printed JSON in the output pane on the right
  3. Check the fix summary to see what changed — fences, commas, quotes, or literals
  4. Pick 2-space, 4-space, or tab indentation to match your project style
  5. Copy the result or download it as a .json file

Example

Input

{ name: 'Ada', active: True, roles: ['admin', 'author',] }

Output

{
  "name": "Ada",
  "active": true,
  "roles": [
    "admin",
    "author"
  ]
}

An unquoted key, single quotes, Python True, and a trailing comma are all repaired.

Common errors & troubleshooting

Frequently asked questions

What kinds of broken JSON can this repair?
Code fences, trailing commas, single and smart quotes, unquoted keys, // and /* */ comments, Python True/False/None, and missing closing brackets. It handles the loose output LLMs and log lines tend to emit, then re-parses so the result is valid.
Does it fix the JSON that ChatGPT or Claude return wrapped in code fences?
Yes. The tool strips the surrounding ```json (or plain ```) Markdown fence first, then repairs whatever is inside. A lone opening fence from a truncated reply is removed too.
Will repairing change my data or just the syntax?
Only the syntax and formatting change; your keys and values are preserved. The one exception is a truncated input, where a dangling key may be filled with null so the document can close and parse.
Can it convert Python-style dicts with True, False, and None?
Yes. Python's True, False, and None become JSON true, false, and null, and single-quoted strings and keys are converted to double quotes, so a pasted Python dict comes out as valid JSON.
What happens if the JSON is cut off or truncated mid-way?
The repair closes any open objects and arrays and fills an incomplete key with null. It is a best-effort rescue — inspect the fix summary and re-run with the full payload when you can.
Does the repaired JSON keep my key order and chosen indentation?
Key order is preserved as written. You choose 2-space, 4-space, or tab indentation, and the output is re-parsed and re-serialized so it is guaranteed to be valid JSON.

Related tools

All ArrayKit tools