DevTools Logo
All posts

JSON5 Explained: Comments, Trailing Commas, and Modern Syntax

August 15, 2026 · DevTools

json5
json
config
developer-tools

JSON5 Explained: Comments, Trailing Commas, and Modern Syntax

Standard JSON is rigid: no comments, no trailing commas, and strict double-quote requirements. JSON5 is an official extension that brings ECMAScript 5.1 object literal syntax to configuration files.

Validate and format JSON5 documents with the JSON5 Validator.

Key Features of JSON5

{
  // Single-line and multi-line comments are supported!
  /* Application Config */
  unquotedKey: 'Single-quoted string values',
  trailingCommaAllowed: true,
  hexadecimalNumbers: 0xdecaf,
  leadingDecimal: .85,
  explicitPositiveSign: +42,
}

Where JSON5 is Used

  • Configuration files (tsconfig.json, Babel configs, ESLint rules).
  • Developer tool settings where explanatory comments are valuable.

Validate your documents using the JSON5 Validator.

Tools mentioned in this post