JSON Fixer and Repair Tool
FV-22Paste broken JSON and press Fix JSON to repair the common syntax mistakes. Press List changes to see exactly what was edited and on which lines. It runs in your browser.
Runs in your browser. Nothing is uploaded.
Broken JSON
Repaired JSON
How to use it
- Paste the broken JSON into the input box.
- Press Fix JSON to get valid JSON, written with the indent you choose.
- Press List changes to see each kind of repair and the lines it touched.
- If you get an error, fix the spot it names and try again.
What it repairs
It removes // and /* */ comments and trailing commas, changes single-quoted strings and keys to double quotes, and quotes bare keys. It turns True, False and None into true, false and null. It adds a comma that is missing between members or items, escapes raw line breaks inside strings, fixes numbers such as +5, .5 and 5., removes a leading byte order mark, and closes brackets left open at the end of the text, in the right order.
What it refuses to do
It never invents data. A key with no value, a string that never closes, a bare word that is not a literal (for example NaN, Infinity or undefined), a number with leading zeros, mismatched brackets and extra text after the value all stop with an error that names the line and column. Guessing there would put values in your data that were never in it.
What stays the same
Strings and numbers are copied exactly as written, so long integers and escapes such as \u00e9 are unchanged. The output is re-indented, so spacing changes even when nothing was broken. The tool fixes syntax only: it does not check that your data makes sense, and it does not remove repeated keys. For text that is not JSON at all, such as a log line, it will report an error.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
There is no JSON here to repair. | The input is empty or holds only whitespace and comments. | Paste the JSON you want to repair. |
The value for the key "a" is missing, and the repair will not invent one at line 1, column 2 | A key has a colon but no value after it, such as {"a": }. The repair will not invent a value. | Type the value you meant, or delete the key. |
Unterminated string (the closing quote is missing, and one is not added because the rest of the text is unknown) at line 1, column 6 | A string starts but its closing quote is never found, so the rest of the text cannot be separated from it. | Add the closing quote where the string ends. |
Unexpected data after the end of the JSON value at line 1, column 4 | A complete value was read and more text follows, such as a second object or an extra closing bracket. | Remove the extra text, or fix the bracket that closed too early. |
Questions people ask
How do I fix invalid JSON?
Paste it and press Fix JSON. Trailing commas, single quotes, unquoted keys, comments, Python-style True, False and None, missing commas and unclosed brackets are repaired. Anything it cannot fix without guessing gives an error with the line and column.
Why does it not fill in a missing value?
A repair tool that makes up values hides the problem. If a key has no value, the tool cannot know whether you meant null, an empty string or something else, so it stops and tells you where.
Does it fix JSON that was cut off?
Partly. If the text ends while objects or arrays are still open, it adds the closing brackets in the right order. If it ends inside a string, or right after a key and colon, it stops with an error, because the missing text is unknown.
Can it repair JSON copied from Python?
It handles the usual differences: single quotes become double quotes and True, False and None become true, false and null. Other Python values, such as a tuple or a date object printed as text, are not JSON and give an error.
How do I see what it changed?
Press List changes. It groups the repairs by kind, such as removed trailing commas, with a count and the line numbers. Missing commas are reported at the line where the next item starts.
Why was my valid JSON reformatted?
The output is always written with the indent you choose, so spacing and line breaks change even when nothing needed repair. The List changes action says when there was nothing to change. Values and key order are unchanged.
About this tool
Rewrites syntax only, then prints the result with the indent you pick. It fixes: // and /* */ comments (removed), trailing commas (removed), single-quoted strings and keys (double quotes), unquoted keys (quoted), True, False and None (true, false, null), a missing comma between members or items, raw line breaks inside strings (escaped), an escaped single quote inside a double-quoted string, numbers with a leading + or a missing digit around the decimal point, a leading byte order mark, and brackets left open at the end of the text (closed in the right order). It never invents data. A key with no value, an unterminated string, a bare word that is not a literal (including NaN, Infinity and undefined), a number with leading zeros, mismatched brackets and extra text after the value all stop with an error that names the line and column. Numbers and string contents are copied exactly as written. The List changes action shows what was changed and on which lines. It does not fix repeated keys, wrong data or text that is not JSON at all.