Step-by-step
- Paste the JSON into the JSON Validator and note the first error and its position.
- Check the characters around that position against the examples on this page.
- Make one fix and validate again.
- Repeat until the document is valid.
- Format the result with the JSON Formatter to confirm that it reads correctly.
Trailing commas
JSON does not allow a comma after the last item.
Invalid: {"name": "Ada", "role": "admin",}
Valid: {"name": "Ada", "role": "admin"}
Single quotes and unquoted keys
Strings and keys must use double quotes.
Invalid: {'name': 'Ada', role: 'admin'}
Valid: {"name": "Ada", "role": "admin"}
Comments and special values
JSON has no comment syntax, so remove // and /* */ comments. The values undefined, NaN and Infinity are also not valid. Use null, a string or a number instead.
Hidden problems from copying
Text copied from a web page or word processor can contain curly quotes such as “ and ”, which look like quotes but are not valid. Replace them with straight double quotes. Unescaped line breaks and quotes inside a string also break parsing. Write a line break as \n and a quote as \".
Truncated JSON
If a response was cut off, the closing brackets are missing. Request the data again, or check whether a size limit is cutting the output.
Finish the task with DevUtilityKits
Use the relevant online utility, check the result, and continue with your development workflow.
Open JSON Validator →Open JSON Formatter →