Fix JSON Parse Error: Expected Property Name

This error usually means a parser reached an object key that is not valid JSON: an unquoted key, a comment, a trailing comma, or JavaScript syntax inside a strict JSON document.

What the Error Means

RFC 8259 JSON object members must always start with a double-quoted property name. When a parser reaches the position where it expects a key and finds anything else, it stops immediately — usually at position 1 or 2, right after the opening { or after a comma.

Where You'll See It

The same root cause produces slightly different error messages depending on the parser:

Parser Error message
JavaScript (JSON.parse, V8 / Node 22+) SyntaxError: Expected property name or '}' in JSON at position 1
JavaScript (older V8 / Node 18-20) SyntaxError: Unexpected token n in JSON at position 2
Python (json.loads) json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
Go (encoding/json) invalid character 'n' looking for beginning of object key string

Different wording, same fix: the parser found something where it expected a " (the start of a key string).

Most Common Causes

Four small mistakes produce almost every report of this error. Each maps to a dedicated sibling guide:

What's there What JSON wants Fix
{ name: "Ada" } — an unquoted key A double-quoted key Fix unquoted keys in JSON
{ 'name': 'Ada' } — a single-quoted key (or value) Double quotes only Fix single quotes in JSON
{ "name": "Ada", } — a trailing comma before } Drop the comma Fix trailing commas in JSON
{ /* user */ "name": "Ada" } — a JavaScript comment JSON has no comments — strip them (See JSON5 if you control both ends)

For the umbrella view across the whole Unexpected token family, see Fix JSON unexpected token errors.

Broken Example

A payload that combines all four causes in one block — each line trips a different parser rule:

{
  name: 'Ada',           // unquoted key + single-quoted string
  active: true,          // OK
  /* this is a comment */
  "tags": ["dev",],      // trailing comma in the array
}

Fixed JSON

{
  "name": "Ada",
  "active": true,
  "tags": ["dev"]
}

Keys double-quoted, string values double-quoted, comment removed, trailing comma removed.

Repair Workflow

  1. Read the parser's error in full. Note the reported line and column — those tell you where the parser stopped, not always where the bug is.
  2. Look one token before the reported position. The "Expected property name" is what the parser couldn't accept; the bug is usually the missing " (or the misplaced , / // / ') that came just before.
  3. Auto-repair with JSON Fix. It handles all four common causes (unquoted keys, single quotes, trailing commas, comments) in one pass, in your browser. The result is strict RFC 8259 JSON.
  4. Validate strictly with the strict JSON validator (or your language's strict parser) to confirm — auto-repair fixes the grammar, validation confirms nothing else is wrong.
  5. Then validate the shape. Auto-repair fixes syntax, not semantics. If the field name, numeric value, date, or enum could be ambiguous, compare the repaired output against the source system's API schema before saving it to a config file, sending it to an API, or pasting it into a database migration.

When Automatic Repair Is Safe

Automatic repair is safe for syntax cleanup when the intended structure is obvious — the four causes above are unambiguous, and the tool only swaps delimiters or strips known-invalid tokens. It should not be treated as business validation. The repair workflow hub walks through the full sequence including the shape-validation step.

See also

This guide covers one common parser error. The hub maps every JSON parser error message to the article that explains it.

Sources

  • RFC 8259 — the JSON Data Interchange Format (IETF, the canonical JSON grammar)
  • MDN — JSON.parse (the JS parser that emits this error)
  • JSON5 — the human-edit-friendly superset that does allow unquoted keys, comments, and trailing commas

Last reviewed June 2026.