Repair JSON

Broken JSON Input

1

Repaired JSON Output

Settings

How JSON Repair Works

When you enter invalid JSON, our system automatically tries these methods in order:

1
JSONRepair Library
Fast, accurate repair for most common issues
2
Basic Pattern Matching
Handles simple syntax errors
3
AI Providers
DeepSeek and others for complex cases

Start repairing JSON

Enter broken JSON data, or click Import to load from a file.

Step-by-step guide: How to repair broken JSON

  1. Step 1 – Paste your broken JSON

    • Copy your invalid or broken JSON code (e.g., from logs, an old API, or a configuration file).
    • Paste it into the left editor panel. You can also drag and drop a file or use the Import button.
    • Don't worry about errors like keys without quotes or trailing commas—this tool is designed to fix them.
  2. Step 2 – Automatic repair process

    • If the JSON is invalid, the Repair button appears (or click it manually).
    • The tool first tries a fast local repair to fix syntax errors instantly.
    • If local repair isn't enough, it seamlessly escalates to our AI repair engine to infer intent and fix structure.
  3. Step 3 – Review the fixed JSON

    • The repaired, valid JSON appears in the right panel.
    • We automatically pretty-print it so you can verify the data structure and values.
    • Check the validity indicator to confirm it now complies with standard JSON syntax.
  4. Step 4 – Use your clean JSON

    • Click Copy to copy the fixed JSON to your clipboard.
    • Download it as a `.json` file for backup.
    • Use Apply to move it to the input side if you want to make further manual edits.

Common issues we fix:

  • Missing quotes around keys (e.g., name: "John""name": "John")
  • Trailing commas (e.g., [1, 2,][1, 2])
  • Single quotes instead of double quotes
  • Unclosed arrays or objects
Example: Fixing a broken configuration object
// Broken Input (Invalid JSON)
{
  name: "Project X",   // Missing quotes on key
  'id': 1024,          // Single quotes
  items: [
    "A",
    "B",               // Trailing comma
  ]
}

// Repaired Output (Valid JSON)
{
  "name": "Project X",
  "id": 1024,
  "items": [
    "A",
    "B"
  ]
}

Related JSON tools

  • After repairing, you might want to format, validate, or convert your data.

Frequently Asked Questions

How does JSON repair work?

Our repair system uses a multi-layered approach: first the JSONRepair library for fast, reliable fixes, then basic pattern matching, and finally AI providers (DeepSeek, OpenRouter, Groq) for complex issues.

Is my data safe and secure?

Yes. All local repairs (JSONRepair library and pattern matching) happen entirely in your browser. We do not store any of your data. If you use the AI repair feature for complex issues, your JSON is sent to our AI provider (DeepSeek) solely for processing and is not stored or trained upon.

What repair methods are used?

1) JSONRepair library - Fast, accurate repair for most common issues. 2) Basic repair - Pattern-based fixes for simple syntax errors. 3) AI repair - DeepSeek and other AI providers for complex structural problems.

Can it fix missing quotes or commas?

Yes. Common errors like missing quotes around keys, trailing commas, missing commas between elements, and mismatched brackets are automatically fixed by our local repair engine.

Is there a size limit for AI repair?

Yes. For reliability, AI repair supports inputs up to approximately (~18000 characters) per request. Larger JSON files can usually be fixed using local JSONRepair/basic methods, or you can split them into smaller chunks before applying AI repair.

Do I need API keys?

No. You don't need any API keys. For complex cases, we enhance results using our DeepSeek API integration (managed by us) on top of local JSONRepair and built-in fixes—so it works out of the box.

How accurate is the repair process?

Very high accuracy for common issues using the JSONRepair library. Basic pattern matching handles simple syntax errors. AI providers provide intelligent analysis for complex structural problems when needed.

JSON Repair Tool - Fix Invalid JSON | JSONSwiss