DevKit Tools

JSON Repair

Repair broken JSON in your browser: close unclosed brackets, strip trailing commas, quote bare keys and convert single quotes.

JSON/JSON Repair

Fix broken JSON: unclosed brackets, trailing commas, single quotes, bare keys and comments.

Repair report

Valid JSON after repair.

  • Closed 1 unclosed bracket: }
  • Removed 1 comment.
  • Converted 3 single quoted strings to double quotes.
  • Quoted 4 bare keys.
  • Removed 1 trailing comma.

Repair guesses at intent. Always read the result before using it, especially when brackets were added, because there is more than one way to close a truncated payload.

{
  "name": "Ada Lovelace",
  "age": 36,
  "skills": [
    "JS",
    "CSS"
  ],
  "active": true
}

Overview

Most broken JSON is not broken by much. It is a JavaScript object literal pasted where JSON was expected, a payload copied out of a log and truncated halfway, or a config file with comments in it. Every one of those is a small, mechanical fix.

This repairs by scanning character by character rather than with find and replace, because the whole difficulty is telling structure apart from the contents of a string, and a search cannot do that. A comma inside a quoted value must survive; the same comma before a closing brace must go.

The repair report matters as much as the repaired text. An automated fix is a guess at intent, and the only safe way to trust it is to see exactly what changed: which bracket was closed, which comma dropped, which quote converted. Every edit is listed, so you are approving the fix rather than hoping it was right.

Step by step

  1. 1Paste the broken JSON.
  2. 2Read the repair report to see exactly what was changed.
  3. 3Check the repaired output, especially if brackets were added.
  4. 4Copy the formatted or minified result.

Notes

  • Repairing and validating are different jobs. The formatter rejects anything non-standard so your config loader will too; this one accepts the mess and cleans it. Reach for repair first, then confirm the result in the formatter.
  • Closing a truncated payload is the one repair to double-check. Brackets are closed innermost first, which is a sensible guess, but a response cut off mid-array can be completed more than one way.
  • The character-by-character scan is what lets it tell data from structure. That is why punctuation inside your quoted strings is never touched, only the punctuation that holds the JSON together.

FAQ

Is my data sent anywhere?

No. The repair runs entirely in your browser, so you can paste a real API response or a config file safely.

Can it always fix my JSON?

No, and it tells you when it cannot. It handles the common cases: unclosed brackets, trailing commas, single quotes, bare keys, comments, and Python style True, False and None.

How does it close a truncated payload?

It tracks which brackets are still open and closes them innermost first. That is a guess at your intent, so read the result. A payload cut off mid array can legitimately be closed more than one way.

Why is my JSON invalid when it looks fine?

Usually a trailing comma before a closing brace, a single quote, an unquoted key, or a comment. All four are valid JavaScript and none of them are valid JSON.

Does it change my values?

No. It edits only structure: brackets, commas, quotes and bare keys. The contents of your strings and numbers are left exactly as they are, which is why a comma inside a quoted value survives the repair.

Try next

More Text & Data tools