How to fix invalid JSON
JSON is strict. Keys and strings need double quotes, and every item except the last needs a comma after it. When the tool finds an error it shows the line and column so you can jump straight to it.
- Trailing comma:
{"a":1,}is invalid. Remove the last comma. - Single quotes:
{'a':1}must become{"a":1}. - Unquoted keys:
{a:1}must become{"a":1}. - Comments: JSON does not allow
//or/* */.
Press Fix common errors when it appears to remove comments and trailing commas automatically. Review the result, since it cannot guess single quotes or unquoted keys.
Example: {"a":1,"b":[1,2]} is 21 characters. Beautified with 2 spaces it spreads over 6 lines, and Minify returns it to 21 characters.
Frequently asked questions
Is my JSON sent to a server?
No. Everything runs in your browser, so private data such as API responses and config files stays on your device.
What is the difference between beautify and minify?
Beautify adds indentation and line breaks so it is easy to read. Minify strips all extra whitespace to make the file as small as possible.
Does sorting keys change my data?
Only the order of keys inside objects changes. Values and array order stay the same.
Why do very large numbers change?
Browsers read JSON numbers as floating point, so integers beyond 9,007,199,254,740,991 can lose precision. Keep such IDs as strings.