Start with the first error, then check what precedes it
A strict parser stops when the next character no longer fits the grammar. That character may be the symptom of a missing comma, an unfinished string, or an earlier unmatched bracket. Fix one issue, then validate again: later error messages can disappear once the first problem is corrected.
Paste the document into JSON Formatter & Validator. Read the line, column, and hint, then use Jump to error. The position uses one-based line and column numbers; column counting follows JavaScript text positions, so characters represented by surrogate pairs take two positions.
Use double quotes for both keys and strings
A JavaScript object literal may accept an unquoted key or single quotes, but standard JSON does not. Quoting only the value is not enough.
Invalid JSON
{name: 'Ada'}Corrected JSON
{"name": "Ada"}If the string itself contains a double quote, escape that quote rather than switching the entire string to single quotes. Keep the property names quoted even when they look like ordinary identifiers.
Put commas between values, not after the last one
Commas separate object members and array items. A trailing comma is rejected in JSON even when a programming language accepts it in source code.
| Invalid | Valid |
|---|---|
{"name": "Ada",} | {"name": "Ada"} |
["HTML", "CSS",] | ["HTML", "CSS"] |
{"a": 1 "b": 2} | {"a": 1, "b": 2} |
[1 2] | [1, 2] |
Check the colon too: each object member has a name and value separated by :. An array contains values directly, so it does not need a property name or a colon for each item.
Escape control characters inside strings
An actual line break inside a quoted string is invalid. Write \n to represent a line break in the value, or close the string before starting a new member. A literal backslash uses \\.
{
"message": "First line\nSecond line",
"quote": "She said \"Hello\".",
"path": "C:\\reports\\data.json"
}Valid short escape sequences include \", \\, \/, \b, \f, \n, \r, and \t. Unicode escapes use \u followed by four hexadecimal digits. JavaScript-style escapes such as \x41 are not JSON escapes.
Use JSON literals and number syntax
Write true, false, and null in lowercase. Values such as True, None, and undefined belong to other languages or contexts.
Numbers may use a minus sign, a decimal fraction, and an exponent. They cannot use a leading plus sign or an unnecessary leading zero. A decimal point needs digits on both sides: write 0.5, not .5, and 5.0, not 5.. Standard JSON does not include NaN or Infinity.
A warning is different from an error. Duplicate object names and large-number interoperability concerns do not necessarily make the grammar invalid. This tool preserves them and warns separately so you can make an informed edit.
Check document boundaries and encoding
A JSON document holds one root value. Two adjacent objects are two documents, even if each object is valid on its own. Put records into an array when the API expects one JSON document, or use a separate JSON Lines workflow when it explicitly expects one document per line.
Open local files as UTF-8 text. A leading byte-order mark can interfere with strict parsing. Repair preview can remove that leading marker, but it does not convert a file from another character encoding.
Use a repair preview without guessing the data
The tool’s repair operation removes comments and trailing commas outside strings, plus a leading byte-order mark. A URL such as "https://example.com" stays a string; its double slash is not treated as a comment.
The proposed text must pass syntax validation before it can be applied. Review the preview, then decide whether those edits match your intent. Missing property names, missing values, and ambiguous quotation problems remain manual work. A validator should not invent a customer ID, a status, or an amount to make a document pass.
A repeatable troubleshooting checklist
- Confirm that you copied the complete document, including its closing braces.
- Validate and inspect the earliest reported error.
- Check the preceding quote, comma, colon, and opening bracket.
- Make one edit, then validate again.
- Review warnings and confirm the result against your application’s expected fields.
Put the explanation to work. Open the tool to format, inspect, or validate your document.
Open JSON Formatter →