Fix the Most Common JSON Syntax Errors

Trailing commas, single quotes, and comments are valid in JavaScript but not in JSON. How to find and fix them quickly.

Reviewed 2026-11-15 · ToolMarket

Rules that trip people up

JSON requires double quotes around keys and string values; single quotes are not allowed. A comma after the last item in an object or array is invalid, and comments are not part of the standard.

Values must be one of string, number, object, array, true, false, or null. Words like undefined, NaN, or unquoted dates are not valid JSON values.

Finding the error

Paste the text into the JSON Formatter. When parsing fails, the error message usually points to the position where the parser gave up; the actual mistake is often just before that point, such as a missing comma on the previous line.

For long files, format a working version and the broken version, then compare them with Text Diff to see exactly what changed.

Keep the original

Formatting changes whitespace only, but editing to fix errors changes content. Save a copy of the original before you start, especially for configuration files that a running system depends on.

Try the related tools

Related guides