JSON5 Guide

JSON5 is an extension of JSON that keeps data friendly for humans and configuration files.

What is JSON5?

JSON5 is a superset of JSON that removes strict quoting requirements and adds comments, trailing commas and additional number forms. It is often used for configuration files and developer-friendly data.

{
  name: 'json5',          // unquoted key and single quote
  version: 1.0,
  features: [              // trailing comma allowed
    'comments',
    'hex numbers',
  ],
  limits: { min: 0x10, max: Infinity },
}

JSON5 syntax rules

JSON5 vs JSON

JSON requires double-quoted keys, no comments, no trailing commas and standard decimal numbers. JSON5 keeps the same value model but relaxes the text format so developers can write and read it faster.

// JSON
{"name":"Ada","tags":["dev","json"]}

// JSON5
{name: 'Ada', tags: ['dev', 'json',],}

Use JSON5 tools

You can format, validate and convert JSON5 with the JSON5 Formatter, JSON5 Validator, JSON5 to JSON and JSON to JSON5 tools on this site.