Single Quotes in JSON: What It Means and How to Fix It
JSON requires double quotes around strings and object property names. Single quotes are valid in many programming languages but are not part of the JSON grammar.
What this JSON error means
SyntaxError caused by 'single-quoted' stringsReplace syntax-level single quotes with double quotes, but do not blindly replace apostrophes that are part of string content. A parser-aware repair is safer than a global search-and-replace.
Broken JSON vs. corrected JSON
Compare the invalid syntax with a corrected version before applying the same change to your payload.
Invalid JSON
{'name':'Ada','role':'engineer'}Valid JSON
{"name":"Ada","role":"engineer"}Common causes of this JSON error
- ●Pasting a Python dictionary representation
- ●Copying a JavaScript object literal
- ●Hand-writing JSON using normal prose conventions
- ●Replacing double quotes globally without considering escaped quote characters
Fix and validate your JSON
After correcting the suspected syntax, run the complete payload through a validator. If it still fails, use the diagnostic tool to locate the next parser error before formatting the final JSON.
Related JSON errors
JSON Unexpected Token Error
Understand and fix JSON unexpected token errors. See broken and corrected examples, common causes, and a fast workflow for finding the exact invalid character.
Unexpected End of JSON Input
Fix “Unexpected end of JSON input” errors caused by truncated JSON, missing braces or brackets, incomplete strings, and empty API responses.
Trailing Comma in JSON
Learn why trailing commas are invalid in standard JSON and fix objects or arrays copied from JavaScript, TypeScript, JSON5, or configuration files.
JSON Property Names Must Be Double-Quoted
Fix JSON with unquoted object keys. Standard JSON requires every property name to be enclosed in double quotes.
Invalid Escape Character in JSON
Fix invalid JSON escape sequences in Windows paths, regex strings, copied text, and backslash-heavy values.
Comments Are Not Allowed in JSON
Learn why // and /* */ comments make strict JSON invalid, and when to use JSONC, JSON5, or separate metadata instead.
JSON error FAQ
What does Single Quotes in JSON mean?
JSON requires double quotes around strings and object property names. Single quotes are valid in many programming languages but are not part of the JSON grammar.
How do I fix Single Quotes in JSON?
Replace syntax-level single quotes with double quotes, but do not blindly replace apostrophes that are part of string content. A parser-aware repair is safer than a global search-and-replace.