About this tool
Most JSON errors come from a trailing comma, a missing quote or single quotes copied from JavaScript. The validator names the likely cause along with the position.
Finding the exact cause of a JSON error
A single misplaced character can make an entire JSON file unreadable, and many programs report the failure with an unhelpful message such as 'unexpected token'. This validator tells you where the problem is and, in most cases, what it probably is, so you can fix it in seconds instead of scanning hundreds of lines by eye.
Most errors fall into a handful of patterns. A trailing comma after the last item in an object or array is allowed in JavaScript but not in JSON. Keys and string values must use double quotes, so single quotes copied from code will fail. Comments are not part of the JSON standard, even though some configuration formats accept them. Special values such as undefined, NaN or a function are not valid JSON either. Unescaped line breaks or quote marks inside a string are another frequent cause, especially in text copied from documents.
When you have a large file with several problems, fix the first reported error and validate again, because one mistake can cause misleading errors further down. If the JSON is generated by your own code, the root cause is often string building by hand; using your language's built-in JSON functions prevents most of these issues. Configuration files for tools that accept comments or trailing commas, sometimes called JSON5 or JSONC, will show errors here even though they work in those tools, which is expected. The check runs entirely in your browser, so private data and credentials stay on your device. Once the file is valid, the formatter makes it easier to read.
How to use it
- Paste your text into the input box, or open a file from your device.
- Adjust the options. The result updates instantly.
- Copy the result, or download it as a file where offered.
Questions
Are trailing commas allowed in JSON?
No. JSON does not allow a comma after the last item in an object or array, even though JavaScript does.
Can JSON use single quotes?
No. Strings and keys must use double quotes.
Last reviewed 16 October 2026.
