fix invalid json
runs in your browser, nothing is uploaded
IDLE
Paste JSON that will not parse and see exactly what is wrong, with a list of repairs you can review before applying them. Nothing is uploaded: the repair runs in your browser.
What auto-fix can repair
Comments, trailing commas, missing commas between items, single quotes and curly “smart” quotes, unquoted keys, and the words NaN, Infinity, undefined, None, True and False, which become null, true or false. Hex numbers and spellings such as .5, 5. or +1 become plain JSON numbers.
It also unwraps the forms JSON often arrives in: a markdown code fence copied from a chat or a README, with or without text around it, and JSONP callbacks such as callback({...}). Input that was cut off is closed where it ends.
How the repair works
The page parses strictly first and reports the first error with its line, column and a caret. If the input can be repaired, it lists the changes with their positions (the first 200, with a count of the rest), and clicking a change jumps to it. Nothing changes until you press apply.
Applying rewrites the input as strict JSON, and undo brings back your original. When a document cannot be repaired safely, for example when a colon is missing between a key and its value, the error stays and points at the spot to fix by hand.
Questions
Will it guess missing data?
Only at the end of cut-off input. A value that was cut off is written as null, a key cut off before its value is dropped, and unfinished objects and arrays are closed. A value missing in the middle of a document is an error, not something it fills in.
Does it keep my comments?
No. JSON has no comments, so they are removed. Undo restores your original if you need them.
Can it repair JSON Lines?
Yes. Documents on separate lines are repaired one by one and written back one per line.
Is the broken JSON uploaded?
No. Parsing and repair both run in this page.