</>
ValidateHTML

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

Invalid JSON
{
  'name': 'John',
  'city': 'New York',
  'active': true
}
Valid JSON
{
  "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 Validator
Recommended

Hostinger Fast & Affordable Web Hosting

Deploy clean, validated JSON APIs on reliable hosting.

Get 80% Off Hosting →

Related JSON Errors

View all JSON errors