Trailing Comma A comma appears after the last item in an object or array. JSON does not allow trailing commas.
Common causes: Copy-pasting from JavaScript code Forgetting to remove comma when deleting last item Using code editors that auto-insert commas How to fix: Locate the last item in the object or array Remove the comma after the last item Ensure no comma appears before closing } or ] {
"name": "John",
"age": 30,
"city": "New York",
}{
"name": "John",
"age": 30,
"city": "New York"
}Missing Colon A property key is not followed by a colon (:). Every key in a JSON object must be followed by a colon before its value.
Common causes: Typing too quickly Forgetting JSON syntax rules Copy-pasting incomplete code How to fix: Find the property key that's missing a colon Add a colon (:) between the key and value Ensure the format is "key": value {
"name" "John",
"age": 30
}{
"name": "John",
"age": 30
}Single Quotes Instead of Double Quotes Strings or keys are wrapped in single quotes (') instead of double quotes ("). JSON only accepts double quotes for strings.
Common causes: JavaScript habits (JS allows single quotes) Copy-pasting from Python code Manual typing without syntax highlighting How to fix: Find all single quotes (') in your JSON Replace them with double quotes (") Make sure both keys and string values use double quotes {
'name' : 'John' ,
'age' : 30
}{
"name": "John",
"age": 30
}Comments in JSON Comments (// or /* */) are present in the JSON. Standard JSON does not support comments.
Common causes: Adding documentation directly in JSON Copy-pasting from JSONC or JSON5 files Confusion with JavaScript syntax How to fix: Remove all // single-line comments Remove all /* */ multi-line comments Consider using a separate documentation file Or use JSON5/JSONC if your parser supports it {
// This is a user object
"name": "John",
/* Age in years */
"age": 30
}{
"name": "John",
"age": 30
}Unquoted Keys or Values Object keys or string values are not wrapped in quotes. All keys and string values must be in double quotes.
Common causes: JavaScript object literal syntax Forgetting JSON is stricter than JS Manual typing errors How to fix: Wrap all object keys in double quotes Wrap all string values in double quotes Numbers, booleans (true/false), and null don't need quotes {
name : "John",
age : 30,
city : New York
}{
"name": "John",
"age": 30,
"city": "New York"
}Invalid Boolean/Null Keywords Boolean or null values are capitalized (True, False, Null, TRUE, FALSE, NULL). JSON keywords must be lowercase.
Common causes: Copy-pasting from Python (True/False) Copy-pasting from SQL (NULL) Caps Lock enabled while typing How to fix: Find all instances of True, False, Null (or uppercase variants) Replace with lowercase: true, false, null Use find-and-replace for quick fixes {
"isActive": True ,
"isDeleted": False ,
"middleName": Null
}{
"isActive": true,
"isDeleted": false,
"middleName": null
}Leading Zeros in Numbers Numbers have leading zeros (e.g., 007, 0123). JSON does not allow leading zeros in numbers.
Common causes: Treating numbers as strings Octal number notation from other languages ZIP codes or IDs that should be strings How to fix: Remove leading zeros from numeric values If the leading zero is important (like ZIP codes), use a string instead Wrap the value in double quotes to make it a string {
"id": 007 ,
"zipCode": 01234
}{
"id": 7,
"zipCode": "01234"
}Hexadecimal Numbers Numbers are in hexadecimal format (0x...). JSON only supports decimal numbers.
Common causes: Copy-pasting from programming code Color codes without quotes Memory addresses or binary data How to fix: Convert hexadecimal to decimal (0x1A = 26) Or wrap in quotes as a string if the hex format is needed For colors, use standard string format: "#FF5733" {
"color": 0xFF5733 ,
"value": 0x1A
}{
"color": "#FF5733",
"value": 26
}Invalid Decimal Point Usage Numbers start or end with a decimal point (.5 or 5.). JSON requires a digit before and after the decimal.
Common causes: Shorthand notation from other languages Incomplete number entry Mathematical notation habits How to fix: Add a leading zero before decimal point (.75 → 0.75) Add a trailing zero after decimal point (5. → 5.0) Or remove the decimal point if it's a whole number (5. → 5) {
"percentage": .75,
"value": 5.
}{
"percentage": 0.75,
"value": 5.0
}Unterminated String A string is opened with a quote but never closed. Every opening quote must have a matching closing quote.
Common causes: Forgetting to close the quote Newlines in string without escaping Accidentally deleting closing quote How to fix: Find the string that's missing a closing quote Add the closing double quote (") at the end of the string If the string spans multiple lines, use \n for newlines {
"name": "John,
"age": 30
} {
"name": "John",
"age": 30
}Unescaped Control Characters Control characters (newlines, tabs, etc.) appear directly in strings without being escaped.
Common causes: Copy-pasting text with actual newlines Not escaping special characters Multi-line strings without proper formatting How to fix: Replace actual newlines with \n Replace tabs with \t Escape backslashes by doubling them (\\) Use JSON.stringify() to auto-escape if generating programmatically {
"message": "Hello
World",
"path": "C:\Users\John"
}{
"message": "Hello\nWorld",
"path": "C:\\Users\\John"
}Missing Closing Brace or Bracket An opening brace { or bracket [ doesn't have a matching closing brace } or bracket ].
Common causes: Incomplete editing Accidentally deleting closing bracket Nested structures with mismatched pairs How to fix: Count opening and closing braces/brackets Use an editor with bracket matching Add the missing closing brace } or bracket ] Format/prettify your JSON to spot mismatches easily {
"users": [
{"name": "John"},
{"name": "Jane"}
,
"count": 2
}{
"users": [
{"name": "John"},
{"name": "Jane"}
],
"count": 2
}Extra Closing Brace or Bracket There's a closing brace } or bracket ] without a matching opening brace { or bracket [.
Common causes: Copy-paste errors Duplicate closing brackets Incomplete deletion of code blocks How to fix: Find the extra closing brace } or bracket ] Remove the duplicate Use bracket matching in your editor to identify pairs Format your JSON to make structure visible {
"name": "John",
"age": 30
}} {
"name": "John",
"age": 30
}Double Comma Two commas appear consecutively (,,) without a value between them.
Common causes: Deleting an item but leaving the comma Accidental double typing Incomplete array/object editing How to fix: Search for ,, in your JSON Remove one of the commas Or add a value between the commas if something was deleted by mistake {
"name": "John",,
"age": 30
}{
"name": "John",
"age": 30
}HTML Response Instead of JSON The response starts with HTML tags (< or <!DOCTYPE) instead of valid JSON. This usually means the server returned an error page.
Common causes: API returned 404 or 500 error page Wrong endpoint URL Server configuration issues Authentication failure redirecting to login page How to fix: Check the API endpoint URL is correct Verify the server is returning JSON, not HTML Check for authentication/authorization issues Look at the HTTP status code (should be 200 for success) Contact the API provider if the issue persists
</span>404 Not Found<span class="text-red-600 dark:text-red-400 font-bold bg-red-100 dark:bg-red-900/40 px-0.5 rounded">
Page not found
{
"error": "Not Found",
"status": 404
}Undefined Value The value "undefined" is used. JSON does not support undefined - use null instead.
Common causes: JavaScript code serialization Missing values in data Incorrect variable references How to fix: Replace "undefined" with null Or remove the property entirely if it's optional When generating JSON from JavaScript, filter out undefined values {
"name": "John",
"middleName": undefined,
"age": 30
}{
"name": "John",
"middleName": null,
"age": 30
}