JSON6 The Next Generation JSON Format

JSON evolved. Modern syntax for modern developers.

100% backward compatible with JSON

What is JSON6?

JSON6 extends JSON with powerful features that bring it into the modern era. Built on ES6+ principles, it removes friction from data serialization while maintaining full backward compatibility.

Write cleaner configuration files, annotate your data structures, and embrace a syntax designed for today's development workflows.

Full backward compatibility: All valid JSON files are valid JSON6 files. You can start using JSON6 features gradually.

Key Features

Modern syntax extensions that make JSON work the way you expect.

Comments

Single and multi-line comments to document your configuration.

// and /* */

Trailing Commas

Add trailing commas in arrays and objects without errors.

["a", "b",]

Unquoted Keys

Object keys don't need quotes if they're valid identifiers.

{name: "value"}

Multi-line Strings

Strings can span multiple lines with backslash escaping.

"line1\
line2"

Single Quotes

Use single or double quotes for strings interchangeably.

'string'

Special Numbers

Hex, Infinity, NaN, leading/trailing decimals, explicit +.

0xFF, .5, +1

Quick Example

// Configuration file in JSON6 { name: 'my-app', version: 2.0, port: 0x1F90, // 8080 in hex features: [ 'comments', 'trailing commas', 'unquoted keys', // trailing comma OK! ], /* Multi-line comments are also supported */ enabled: true, threshold: .5, // leading decimal }

This file is both valid JSON6 and valid ES5 JavaScript!

JSON vs JSON6

See what JSON6 adds to make your config files more readable.

Feature JSON JSON6
Comments Not allowed // and /* */
Trailing commas Syntax error Allowed
Unquoted keys Must quote all If valid identifier
String quotes Double only Single or double
Hex numbers Not supported 0xDECAF
Infinity/NaN Not supported Supported
Multi-line strings Not supported With \ escape

Perfect For

JSON6 is built for modern development workflows.

Config Files

App settings with comments

Package Manifests

Annotated dependencies

Data Files

Human-readable datasets

Test Fixtures

Documented test data

Ready to Learn More?

Explore our comprehensive guides, examples, and resources to master JSON6.