What it does
JSON Repair looks for mistakes that have exactly one safe, unambiguous fix and applies only those: a trailing comma before } or ], single-quoted strings, unquoted object keys, stray semicolons where JSON expects a comma, // and /* */ comments, and the Python-style literals True, False and None. Every fix is listed in the Changes table above, with a line-by-line diff so you can see precisely what moved.
What it never changes
Numbers, strings, keys, array order and object order are copied through exactly as written - including Unicode content, escaped characters and large numeric IDs. The tool never reorders data, never invents a missing value, and never closes a bracket or adds a comma it cannot place with certainty. If a document has more than one plausible fix, or needs a human decision such as a missing comma between two unrelated values, it refuses with "No safe deterministic repair available" rather than guessing.
How to use
- Paste your JSON into Original.
- Validate checks it without changing anything, and reports the exact line and column of the first problem.
- Repair applies only the safe fixes above and shows every change made.
- Format re-indents already-valid JSON (whitespace only, like JSON Formatter).
- Copy or download the repaired result, or send it straight to another JSON tool with Send to.
LLM output mode
Tick LLM output mode before pressing Repair to clean typical AI-chat problems first, then run the normal repair on the result. In this order it: removes a chat sentence before the first { or [ and any text after the matching close; removes markdown code fences (if the reply holds several JSON blocks, a selector lets you choose one); replaces typographic quotes with ASCII quotes only where they delimit strings; converts None, True and False outside strings; removes comments outside strings; completes output that was cut off; and replaces NaN and Infinity with null. Every edit is listed in the Changes table and the diff, and the page shows Valid JSON: yes/no afterwards. The mode is off by default and, when off, the tool behaves exactly as before.
Limits: when output was cut off, the tool closes the open string and brackets and drops a dangling key or trailing comma. That is a guess: the data after the cut is missing, and a warning is shown whenever it happens. Replacing NaN or Infinity with null loses the original value and is flagged the same way. Text inside strings is never treated as a comment, a Python literal or a quote to fix. LLM output mode accepts up to 2 MB.
Large input
Input under about 150 KB is processed instantly on the page. Larger input (up to 10 MB) is handed to a background Web Worker so the page never freezes, with a 15-second safety limit.
Example: nine fixes, all listed
The built-in example is a JSON-like snippet with several typical mistakes:
{'name': 'DevToolEra', tags: ['a', 'b',], active: True, note: "hi"}The tool reports “9 issues” and applies nine changes, each with its line in the Changes table: four single-quoted strings converted to double quotes, three unquoted keys (tags, active and note) put in quotes, one trailing comma removed and True changed to true. The result is valid JSON:
{
"name": "DevToolEra",
"tags": [
"a",
"b"
],
"active": true,
"note": "hi"
}Your input is not modified; the repaired text appears in a separate output. The tool tells you to review it before you use it, because a repair is still a decision about what you meant.
Frequently asked questions
Which kinds of broken JSON can it not fix?
Anything with more than one possible meaning, for example a missing closing bracket in the middle of a document. It leaves such cases alone and answers “No safe deterministic repair…”, instead of guessing.
Does repair change my numbers or the order of keys?
No. Numbers, strings, keys and the order of arrays and objects are copied exactly. Only the listed syntax problems change.
How is this different from the LLM JSON Guard?
The LLM JSON Guard also extracts JSON out of chat text and checks the result against a schema. This tool is the focused repair step.
Is my text uploaded?
No. The repair runs in your browser.
Privacy
Parsing and repair run entirely in your browser using the same engine as JSON Formatter. Nothing you paste is ever sent to a server.