JSON Formatter & Validator

Single quotes in JSON: "Expected property name or '}'"

JSON only accepts double quotes. See the exact Chrome, Node.js and Python errors for single-quoted strings and how to convert them.

Error messages you may see

Chrome · Edge · Node.jsSyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2)
Older Chrome · Node.js 18 and earlierSyntaxError: Unexpected token ' in JSON at position 1
Python json.loadsjson.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
This toolLine 1, Col 2: Strings and keys must use double quotes (")

Why it happens

Keys and strings in JSON must use double quotes ("). Single quotes are valid in JavaScript and Python, so this usually happens when an object literal or a Python dict is copied as JSON.

Invalid

{'name': 'Kim', 'age': 30}

How to fix

Replace the single quotes around keys and strings with double quotes. In Python, create the text with json.dumps() instead of str() or print(). In JavaScript, use JSON.stringify().

Fixed

{"name": "Kim", "age": 30}

Open this example in the JSON formatter →

Tip: the formatter fixes this in one click with the 🔧 Auto-fix button.

Other common JSON errors