TinyTools

JSON Repair Online

Automatically detect and fix invalid JSON syntax errors: trailing commas, single quotes, unquoted keys, Python booleans, and comments.

Runs locally in your browser. Your data is never uploaded to any server.
Ready
0 repairs applied
Broken / Invalid JSON
0 chars 0 lines 0 B
Repaired Valid JSON
0 chars 0 lines 0 B

How to Fix Broken JSON: Multi-Pass Automated Repair Engine

Unlike tolerant JavaScript object literals or Python dictionaries, the JSON standard (RFC 8259) is notoriously strict. A single misplaced trailing comma, an unquoted object key, or a stray code comment will trigger fatal parse errors (SyntaxError: Unexpected token) across virtually every programming language runtime. TinyTools JSON Repair diagnoses and repairs these malformed payloads automatically.

How to Repair Invalid JSON

  1. Paste Malformed Payload: Paste your broken JSON or Python dictionary into the left editor.
  2. Inspect Automated Fixes: The repair engine automatically removes comments, wraps keys in double quotes, removes trailing commas, and normalizes booleans, displaying an audit log of every change made.
  3. Copy or Download: Copy your newly validated, pretty-printed JSON directly to your clipboard or download it as a .json file.

Code Example: Broken Input vs Repaired Output

Here is a malformed snippet containing 4 distinct syntax violations (unquoted keys, single quotes, Python True, and a trailing comma):

{
  server: 'aws-east-1',
  ready: True,
  ports: [80, 443,],
}

After automated repair, all keys are quoted, single quotes are replaced, Python booleans are lowercased, and trailing commas are stripped:

{
  "server": "aws-east-1",
  "ready": true,
  "ports": [
    80,
    443
  ]
}

The 6 Most Common JSON Syntax Errors & How We Fix Them

1. Trailing Commas

Commas after the final item in an object or array (e.g., {"a": 1,}) break JSON parsers. We strip trailing commas before closing braces and brackets.

2. Single Quotes Instead of Double Quotes

JSON strictly mandates double quotes ("). Strings or keys enclosed in single quotes ('key': 'value') are converted automatically.

3. Bare / Unquoted Property Keys

JavaScript object notation allows unquoted keys like { name: "John" }. JSON requires quoted keys ({ "name": "John" }).

4. Python Booleans & None

Copying Python dict outputs introduces capitalized keywords (True, False, None). We convert them to true, false, and null.

5. Stray Comments

Developers often annotate configs with // comments or /* block comments */. Our parser strips comments while preserving content inside quotes.

6. Missing Closing Braces

Truncated payloads copied from terminals or log files often miss closing } or ] tokens. We automatically balance open structures.

Related JSON Tools

Browse All JSON Tools

Frequently Asked Questions

How does JSON repair work?

The JSON repair engine runs a multi-pass heuristic analyzer to detect common syntax flaws—such as unquoted keys, trailing commas, single quotes, Python-style booleans (True/False/None), JavaScript comments, and missing brackets—and automatically corrects them into RFC 8259-compliant JSON.

Can this tool fix trailing commas?

Yes. Trailing commas before closing braces (}) or brackets (]) are strictly forbidden in standard JSON. TinyTools strips all trailing commas in a single click.

Does the repair engine support Python dictionary strings?

Yes. If you paste a Python dict containing single quotes and booleans like True, False, or None, the repair tool converts them into double quotes and valid JSON true, false, and null primitives.

Are comments allowed in JSON?

Standard JSON does not support comments (// or /* */). TinyTools automatically strips these comments so your JSON can be parsed by strict API parsers and databases.

Is my broken JSON kept secure and private?

Yes. All repairing and validation happens 100% locally in your browser. None of your data or tokens are ever sent across the network.