Expected ',' or '}' After Property Value in JSON: Every Cause and Fix
This is the error modern V8 (Chrome, Edge, Node 20+) throws when JSON.parse() has just finished a value inside an object and the next character is not a comma or a closing brace. It is the most common JSON error in practice, and the position it reports is routinely not where the mistake is. Older engines said Unexpected token plus a character; this wording names what the parser wanted, which is what makes it fixable.
", a comment or stray character got in, or the object was never closed. Look at the text just before the reported position, then use the table below.
What the parser actually checked
| Message | Container | What was legal at that point |
|---|---|---|
Expected ',' or '}' after property value in JSON at position N | Object | A comma (more properties) or } (end of object) |
Expected ',' or ']' after array element in JSON at position N | Array | A comma (more elements) or ] (end of array) |
Expected ':' after property name in JSON at position N | Object, after a key | A colon, nothing else |
The first two are one check in two containers. If the message names ] when you thought you were inside an object, a bracket earlier in the text is mismatched; see cause 6.
1. A missing comma between properties
The classic. Two properties with nothing between them, usually from hand-editing, a bad merge, or a template that forgot a separator:
JSON.parse('{"name": "Ava" "age": 30}');
// SyntaxError: Expected ',' or '}' after property value in JSON at position 15 (line 1 column 16)
Position 15 is the opening quote of "age". The mistake is the gap right before it: the parser had read "Ava", wanted a comma, and found a quote. In a formatted file the line and column are the useful part:
JSON.parse('{\n "name": "Ava"\n "age": 30\n}');
// SyntaxError: Expected ',' or '}' after property value in JSON at position 20 (line 3 column 3)
Line 3 is the line after the line that needs the comma. Add the comma to the end of the line above.
See it fail live
Missing comma, multi-line: the error reports line 3, the fix belongs on line 2:
Open this example in JSON Lab2. Unescaped double quotes inside a string
This one produces the most baffling positions. A double quote inside a string value ends that string, so everything after it is parsed as JSON:
JSON.parse('{"quote": "She said "hello" and left"}');
// SyntaxError: Expected ',' or '}' after property value in JSON at position 21 (line 1 column 22)
The parser read "She said " as the complete value, then hit the h of hello at position 21. Nothing in the message mentions quotes. The error always lands on the first word after the stray quote, so check the character before the reported position. Fix by escaping it (\"), or better, stop hand-building JSON: JSON.stringify() or json.dumps() escapes every quote for you. User-generated text such as comments, titles and addresses is where this appears first.
3. A missing closing brace (truncated or hand-edited)
An object that is opened and never closed gives this error when the text ends. The position equals the text length: the parser ran out of characters while still wanting a comma or }.
JSON.parse('{"user": {"id": 1, "name": "Ava"}');
// SyntaxError: Expected ',' or '}' after property value in JSON at position 33 (line 1 column 34)
The inner object closed; the outer never did. If you got this from an HTTP response, the usual suspect is truncation: a proxy cutting the body, a response cut off at a size limit, a stream parsed before it finished. Check Content-Length against what you received before you blame the payload. Engines that report truncation differently will show Unexpected end of JSON input for the same text.
See it fail live
Outer object never closed (position 33, the end of the text):
Open this example in JSON Lab4. A comment after a value
Strict JSON has no comments. Config files that tolerate them (tsconfig.json, editor settings) lead people to assume it does. After a value, a comment is simply an unexpected character:
JSON.parse('{"port": 8080 // dev\n}');
// SyntaxError: Expected ',' or '}' after property value in JSON at position 14 (line 1 column 15)
Position 14 is the first /. Remove the comment, or parse with a JSONC or JSON5 library if the file is meant to be commented. A comment before a key gives a different message, covered in Expected property name or '}'.
5. A stray character after a value
A value that does not end cleanly leaves junk for the next check to trip over. Common forms: a number with trailing letters or units, a semicolon instead of a comma, a copy-paste artifact.
JSON.parse('{"id": 12abc}');
// SyntaxError: Expected ',' or '}' after property value in JSON at position 9 (line 1 column 10)
The parser accepted 12 as a number and stopped at a. The same message appears for {"a": 1; "b": 2} (position 7, the semicolon). The cause is usually upstream: IDs or amounts concatenated with units, or a serializer for another language emitting its own separators. Fix the producer.
6. A mismatched bracket: the array variant
If the error says after array element and names ], you closed an array with the wrong character, or a bracket earlier in the text was never closed:
JSON.parse('{"tags": ["a", "b"}');
// SyntaxError: Expected ',' or ']' after array element in JSON at position 18 (line 1 column 19)
Position 18 is the } that was supposed to be ]. The inverse mistake, closing an object with ], gives the property-value message. In deeply nested data, count openers against closers, or paste into a tool that pinpoints the line instead of counting by hand.
Debugging checklist
- Note whether the message says property value (inside an object) or array element (inside an array).
- Go to the reported position, then look at the text immediately before it. The parser reports where it gave up, not where you slipped.
- Is a comma missing? In a formatted file, check the end of the line above the reported line.
- Is there a
"inside a string value? The reported character is usually the first word after it. - If the position equals the length of the text, the text is truncated or a closing brace is missing. Compare against the source or the
Content-Length. - Fix whatever produced the text (
JSON.stringify(),json.dumps()) rather than patching the output with regexes.
Related errors with different causes: Unexpected token in JSON covers a wrong first character (HTML error pages, BOMs, undefined).
📋 Paste it and see exactly where it breaks
JSON Lab formats and validates entirely in your browser, so nothing you paste is uploaded. The optional AI Repair button is the exception: it sends your input to Google's Gemini API.
Open JSON Lab →