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.
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.
Check Your JSON Now
Our JSON validator detects this error automatically and shows the exact line and column.
Open JSON ValidatorHostinger — Fast & Affordable Web Hosting
Deploy clean, validated JSON APIs on reliable hosting.
Related JSON Errors
Unexpected Token in JSON
Learn why JSON throws an unexpected token error and how to fix it. Common causes include trailing commas, single quotes, and unquoted keys.
Unquoted Property Keys in JSON
JSON requires all property names to be wrapped in double quotes. Learn how to fix unquoted key errors.
Invalid Escape Characters in JSON
Learn which escape sequences are valid in JSON strings and how to fix invalid ones.