JSON Repair
Fix the everyday mistakes that stop JSON from parsing — then review the corrected output before you trust it.
Your data stays on your device
Input — Broken JSON
- characters
- 0
- lines
- 0
- size
- 0 B
Output — Repaired JSON
- characters
- 0
- lines
- 0
- size
- 0 B
Options
About this tool
A lot of "JSON" in the wild is almost-JSON: single quotes from a Python print, an unquoted key from a config file, a trailing comma, a comment, or a bracket that never got closed. This tool parses that input leniently and rebuilds it as strict, valid JSON.
Repair never runs by itself. You paste the broken input, press Repair, and compare the corrected output against the original before using it — because some fixes, like dropping a stray token, can change meaning. Every assumption the repairer made is listed as a warning.
Most broken JSON arrives from a predictable set of places. A Python dictionary printed with print() uses single quotes and True/False/None. A JavaScript object literal copied out of a source file has unquoted keys and often a trailing comma. A configuration file written by hand picks up // comments. A log line truncated by a size limit ends mid-object. The repairer recognises all four shapes and rebuilds strict JSON from them.
Because it rebuilds rather than patches, the output is re-serialised from a parsed value. That means the result is always syntactically valid — but it also means formatting, key order inside objects and insignificant whitespace come from the serialiser, not from your original text. Run the result through the Formatter or Sorter afterwards if you need a specific layout.
How to use this tool
- Paste the broken or non-standard JSON you want to fix.
- Press Repair to rebuild it as valid JSON.
- Read the warnings describing what was changed.
- Compare against the input, then copy or download the repaired result.
Key features
- Converts single quotes to double quotes
- Adds quotes around unquoted object keys
- Removes trailing commas and comments
- Maps Python True/False/None to JSON literals
- Closes unclosed objects, arrays and strings
- Lists every change it made as a warning
Example
Input — JSON
{'id': 7, 'active': True, 'note': None}Output — JSON
{
"id": 7,
"active": true,
"note": null
}Input — JSON
{name:'api', tags:['a','b',], ok:True}Output — JSON
{
"name": "api",
"tags": [
"a",
"b"
],
"ok": true
}Good to know
- Repair is best-effort. Ambiguous input can be fixed in more than one way, so always review the result.
- It cannot recover data that is genuinely missing; it can only make the existing text parseable.
Frequently asked questions
Will it change my data?
It only changes syntax, but some syntax fixes can alter meaning — for example closing a bracket in a different place than you intended. That is why every change is reported and nothing is applied automatically.
What kinds of problems can it fix?
Single quotes, unquoted keys, trailing commas, // and /* */ comments, Python-style True/False/None, and unclosed brackets or strings are the common cases.
Is my input uploaded?
No. Repair runs entirely in your browser tab.
Why does my repaired document look reformatted?
The repairer parses your input and re-serialises it, so indentation and spacing come from the serialiser. The data is unchanged; only the layout is normalised. Use the Formatter or Sorter afterwards if you need a particular style.
Can it repair newline-delimited JSON (NDJSON)?
Not as a whole file. NDJSON is a sequence of separate documents, and this tool repairs one document at a time. Repair each line individually, or wrap the lines in an array first.
What happens to a value it cannot understand?
A bare word that is not true, false or null is kept as a quoted string rather than discarded, and a warning tells you it happened — so you can decide whether that was the right call.
Your data stays on your device
Your data is processed locally in your browser and is not uploaded to our server. This page keeps working after you go offline, because there is nothing to send.