</>
ValidateHTML

Unquoted Property Keys in JSON

In JavaScript, object keys don't need quotes if they are valid identifiers. In JSON, every key must be a double-quoted string, no exceptions. This is one of the most common mistakes when converting JavaScript objects to JSON.

Why It Matters

The JSON parser fails at the first unquoted key. This is a frequent source of bugs when developers manually write JSON or copy JavaScript objects into .json files.

Code Examples

Invalid JSON
{
  name: "John",
  age: 30,
  isActive: true
}
Valid JSON
{
  "name": "John",
  "age": 30,
  "isActive": true
}

How to Fix

  • 1Wrap every property name in double quotes.
  • 2Use JSON.stringify() in JavaScript to automatically generate valid JSON from an object.
  • 3If converting from YAML or another format, ensure keys are quoted in the output.
  • 4Configure your editor to highlight JSON syntax errors with a JSON language mode.

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