Why will my JSON not validate?
Learn how missing commas, quotes, and brackets can affect a JSON document.

Why JSON validation fails
A JSON document fails validation when its syntax breaks the JSON grammar. Common causes include single quotes, an unquoted property name, a missing comma, a trailing comma, comments, or mismatched braces and brackets. Start with the first reported error and inspect the preceding line too.
Valid JSON is not the same as valid application data. A document can parse successfully and still contain the wrong field names, data types, or values for the system that receives it.
Use double quotes for keys and strings
Object property names and string values must use double quotation marks. For example, {"name": "Ada", "active": true} is valid JSON. Single quotes and typographic “smart quotes” cannot replace the straight double quotes used as delimiters.
A double quote inside a string needs escaping with a backslash. Backslashes themselves also need escaping. When copying a Windows file path or text from a document editor, check these characters carefully. A raw line break cannot appear inside a JSON string; use an escaped newline sequence instead.
Check commas and matching brackets
Use commas between object properties and between array items. Do not put a comma after the last property or item. For example, [1, 2, 3] is valid, while [1, 2, 3,] is not.
Curly braces enclose objects, and square brackets enclose arrays. Every opening bracket needs the corresponding closing bracket. If the validator points to a closing brace, the real issue may be a missing value, extra comma, or unmatched bracket earlier in the document.
Remove JavaScript-only syntax
JSON is a data format, not a JavaScript program. Comments, undefined, functions, NaN, and Infinity are not JSON values. Use strings, numbers, objects, arrays, true, false, or null, as appropriate for the receiving system.
Write booleans and null in lowercase without quotes. The string "false" is different from the boolean false. Numbers cannot have leading zeroes such as 007; use a string if the zeroes are part of an identifier. Duplicate object keys may parse, but different consumers can handle them differently, so remove ambiguity before sending the data.
How to fix an invalid JSON file
- Keep the original text so you can recover values if an edit goes wrong.
- Open the JSON formatter and paste or load the document. Read the first error before changing anything.
- Inspect the reported position and the line before it. Check quotes, commas, and the surrounding brackets.
- Make one correction, validate again, and repeat until the document parses.
- Format the valid document to inspect its structure. Check field names and value types against the destination’s requirements.
What to check after the syntax is valid
Formatting makes JSON easier to read; it does not prove that the data is complete or correct. Confirm required fields, units, date conventions, and whether a field should contain a number or a string. Be especially careful with long numeric identifiers, which some software cannot represent exactly as numbers.
If the source is a spreadsheet or CSV file, use the CSV–JSON converter below instead of manually adding quotes and commas to every row. After conversion, inspect empty cells, column names, and representative records before importing the result.
Useful tools
JSON formatter and validator
Beautify, validate or minify JSON. Keep large numbers, key order and duplicate keys intact, directly in your browser.
CSV to JSON converter
Convert CSV to JSON and JSON to CSV. Choose separators, preserve leading zeros and copy or download the result locally.