JSON validator

Expected double-quoted property name in JSON

SyntaxError: Expected double-quoted property name in JSON at position 32 (line 4 column 1) means the parser expected a key in double quotes but found something else. It's almost always a trailing comma before }, or JavaScript object syntax that isn't valid JSON.

Paste your JSON below; the label above the editor shows the line and column of the problem.

JSON validator
InputLine 4, column 1JSON

Press Command or Control plus Enter to run. Tab inserts indentation; press Escape, then Tab, to leave the editor.

Result
Your result will appear here.
Ready4 lines · 33 chars

Causes and fixes

Invalid JSONErrorFix
{"a": 1,}Expected double-quoted property nameRemove the trailing comma.
{a: 1}Expected property name or '}'Quote the key: {"a": 1}.
{'a': 1}Expected property name or '}'Use double quotes.
{"a": 1, // noteExpected double-quoted property nameRemove the comment.

Config files with comments

Files like tsconfig.json and VS Code's settings.json are JSONC (JSON with comments), which allows comments and trailing commas. JSON.parse can't read them. Use a JSONC parser such as the jsonc-parser package, or remove the comments and trailing commas first.

Copied from JavaScript code?

An object literal from source code isn't JSON. Convert it in the browser console, which prints valid JSON:

copy(JSON.stringify({ name: 'Ada', age: 36, }, null, 2));
// Clipboard now contains:
// {
//   "name": "Ada",
//   "age": 36
// }

Frequently asked questions

Why doesn't JSON allow trailing commas?

JSON was designed to be minimal and has never changed its grammar, so every parser in every language reads it the same way. JavaScript, JSON5 and JSONC allow trailing commas; strict JSON does not.

How do I find the position in a large file?

The error gives a character position, which is hard to count by hand. Paste the JSON into the validator, which turns it into a line and column.

Can a single quote ever appear in JSON?

Inside a string, yes: "it's" is valid. Only the quotes around keys and string values must be double quotes.

More json validator guides

Open the full json validator →

From the blog