Single Quotes in JSON
JSON requires all strings and property names to be wrapped in double quotes. Single quotes, backticks, or unquoted strings are not valid JSON. This rule exists because JSON is a strict data interchange format, not a programming language.
Why It Matters
Any JSON with single quotes will fail to parse in every standard JSON parser. APIs reject the payload, configuration files fail to load, and data exchanges break.
Common Causes
- Writing JSON by hand with the single-quote habit carried over from JavaScript or Python.
- Using Python's print() or str() on a dict, which emits single quotes, then saving the result as JSON.
- Pasting a string that uses curly typographic quotes from a word processor instead of straight double quotes.
Code Examples
{
'name': 'John',
'city': 'New York',
'active': true
}{
"name": "John",
"city": "New York",
"active": true
}How to Fix
- 1Replace all single quotes with double quotes for both keys and string values.
- 2If your string contains double quotes, escape them with a backslash: \".
- 3Do not use backticks or template literals. They are not valid in JSON.
- 4Use a find-and-replace to quickly swap single quotes to double quotes in your editor.
Frequently Asked Questions
Why does JSON only allow double quotes?
How do I include a double quote inside a JSON string?
Are smart or curly quotes valid in JSON?
Check Your JSON Now
Our JSON validator detects this error automatically and shows the exact line and column.
Open JSON ValidatorCloudways · Managed Cloud Hosting
Fix this JSON error, then deploy on Cloudways managed cloud (AWS, GCP, DigitalOcean).
Free 3-day trial · 30% off 3 months + free site migration with code MIGRATE303
Related JSON Errors
Unexpected Token in JSON
Fix the unexpected token error in JSON fast. See why parsers fail on trailing commas, single quotes, unquoted keys, and comments, with clear examples.
Unquoted Property Keys in JSON
JSON requires every property name wrapped in double quotes, so bare keys fail. Learn how to fix unquoted key errors when converting JavaScript objects.
Invalid Escape Characters in JSON
Learn which escape characters are valid in JSON strings and how to fix the invalid ones. Windows file paths and regex patterns are the usual culprits.