Fix JSON Single Quotes Errors

JSON requires double quotes. See why single-quoted keys and strings fail, check your text with the validator, and fix the quotes quickly.

Part of the free JSON Formatter & Validator. Runs in your browser — nothing is uploaded.

Fix JSON Single Quotes Errors

Python dictionaries and JavaScript object literals happily use single quotes, but JSON does not. If you copied a printed Python dict or a JS object into a JSON file, the parser will fail on the first quote. Paste it below to confirm and fix it.

Worked example: Single-quoted text fails validation

Not JSON

{'name': 'Ada', 'active': true}

Validator result

✗ Invalid JSON
Expected property name or '}' in JSON at position 1 (line 1 column 2)

Practical tip

Replace every single quote around keys and strings with double quotes. In Python, use json.dumps(obj) instead of str(obj) so the output is real JSON.

How to use this JSON Formatter

  1. 1Use the live tool above — it runs entirely in your browser and never uploads your data.
  2. 2Paste the sample from the worked example, or use your own input.
  3. 3Copy the result, then adapt the same steps in your editor, script, or pipeline.

Fix JSON Single Quotes Errors FAQs

Why does my Python print() output fail as JSON?

print(dict) shows Python syntax: single quotes, True/False and None. JSON needs double quotes and lowercase true, false and null. Use json.dumps to produce valid JSON.

Can I use single quotes inside a JSON string?

Yes. A single quote character is fine inside a double-quoted JSON string. Only the delimiters around keys and string values must be double quotes.

More JSON Formatter pages

Open the full JSON Formatter tool →