The JSON Format Family and
Where JSON5 sits among JSONC, JWCC, Hjson, HOCON, CSON, JSON6 and JSOX.
People keep extending JSON because it is simple enough to extend. Each variant draws the line in a different place: some add only comments, some borrow ECMAScript 5.1 syntax, some follow later JavaScript, and some rebuild the notation around the person typing it.
This page maps the relatives, compares their features, records where each one is specified and maintained, and shows what happens when one file meets several parsers. Line-delimited JSON gets its own section because it solves a different problem.
TL;DR: Use plain JSON between programs. For hand-edited files, JSONC and JWCC add comments (and, depending on the tool, trailing commas) and nothing else. JSON5 adds those plus ECMAScript 5.1 conveniences under a written 1.0.0 specification. Hjson, HOCON and CSON are different notations that a JSON5 parser cannot be assumed to read. JSON6 and JSOX extend further than JSON5. JSON Lines and NDJSON are framing rules for streams, not new syntax.
The Family Tree
"Family" is a loose word here. These formats share the JSON data model of objects, arrays, strings, numbers, booleans and null, but only a few were designed as descendants of one another. The diagram groups them by design approach. Years mark the first public specification, repository or package we could date, and the table further down says which is which.
JavaScript object literals
ECMAScript, the source of the syntax
JSON
Early 2000s; RFC 4627 in 2006
Minimal additions
JSONC
VS Code usage; parser on npm 2016
HuJSON / JWCC
Go library 2019; name JWCC 2021
JavaScript syntax line
JSON5
2012; ECMAScript 5.1 syntax
JSON6
2017; adds ES6-era syntax
JSOX
2018; adds types, builds on JSON6
JSONext
2016; separate experiment from JSON5
Rewritten for people
HOCON
2011; configuration with includes
CSON
2011; CoffeeScript object notation
Hjson
2014; quoteless strings
Separate concern: one JSON value per record
NDJSON (2013), JSON Lines (2013), JSON Text Sequences (RFC 7464, 2015)
The vertical links in the middle column are documented ones. The JSONext README shows JSON5 syntax as its base. JSON6 says its documentation was cloned from the JSON5 project and that it includes all of its features. JSON6's README also says JSOX builds upon it, and JSOX's README calls JSON, JSON5 and JSON6 documents valid JSOX, although our test found one exception. The other columns are independent answers to the same complaint.
Feature Matrix
The matrix describes what each format accepts. We ran short probe documents through JSON.parse, jsonc-parser 3.3.1, json5 2.2.3, hjson 3.2.2, cson-parser 4.0.9, json-6 1.1.7 and jsox 1.2.128. The JWCC and HOCON columns come from their written definitions.
| Feature | JSON | JSONC | JWCC | JSON5 | Hjson | HOCON | CSON | JSON6 | JSOX |
|---|---|---|---|---|---|---|---|---|---|
// comments | |||||||||
/* */ comments | ### blocks | ||||||||
# comments | |||||||||
| Trailing comma | Parser option | Inside brackets | |||||||
| Unquoted keys | Identifier names | ||||||||
| Single-quoted strings | |||||||||
| Multi-line strings | Backslash continuation | ''' blocks | """ blocks | ||||||
| Hex numbers | Read as a string | Read as a string | |||||||
Infinity and NaN | Read as a string | Read as a string | |||||||
| Commas optional between lines | |||||||||
undefined, 0b, 0o | 0b and 0o only | ||||||||
| BigInt and date literals | |||||||||
| Includes and substitutions |
A yes means the construct is accepted, not that two formats give it the same meaning. The one-file test below shows how that difference bites.
Origins, Specifications and Maintenance
Of the media types listed, only application/json and application/json-seq appeared in the IANA application registry when we downloaded it on November 29, 2026. Everything else is a proposal or a convention. Maintenance dates are the latest release or commit we saw that day.
| Format | Origin | Specification | Media type | Extension | Maintenance |
|---|---|---|---|---|---|
| JSON | Early 2000s; RFC 4627, July 2006 | RFC 8259 and ECMA-404 (both December 2017) | application/json, registered | .json | Published standard |
| JSONC | VS Code convention; jsonc-parser on npm April 2016 | jsonc.org draft (repository created 2025) | application/jsonc, proposed by the draft | .jsonc | Parser 3.3.1 (June 2024); commits October 2026 |
| JWCC / HuJSON | HuJSON repository 2019; JWCC post February 2021 | Blog definition by Nigel Tao | application/jwcc, proposed by the author | .jwcc, .hujson | HuJSON commits November 2026 |
| JSON5 | First npm publish May 2012 | Specification 1.0.0, March 2018 | The specification defines none; none registered | .json5 by convention | Library 2.2.3 (December 2022); unreleased work on the main branch |
| Hjson | First draft March 2014 | Syntax page; an Internet-Draft from 2016 that expired | application/hjson, proposed in that draft | .hjson | Community-supported; hjson-go 4.7.1 (September 2026), hjson for JavaScript 3.2.2 (2020) |
| HOCON | Library repository 2011 | HOCON.md, self-described as informal | application/hocon, named in the document | .conf | Typesafe Config 1.4.10 (November 2026) |
| CSON | Repository 2011 | Defined by its parsers | None stated | .cson | cson 8.4.0 (December 2023); cson-parser 4.0.9 (March 2021) |
| JSONext | Repository December 2016 | README only | None stated | .jsonext | Dormant: 1.1.0, September 2017 |
| JSON6 | Repository July 2017 | README of the reference implementation | Marked as still to be done | .json6 | json-6 1.1.7 (October 2026) |
| JSOX | Repository September 2018 | Internet-Draft, first posted August 31, 2026 | application/jsox, proposed by the draft | .jsox | jsox 1.2.128 (September 2026) |
For the standing of JSON5 itself, see Standards Status, History and the file extension guide.
JSON: The Common Ancestor
Douglas Crockford specified JSON in the early 2000s as a data format drawn from the object literals of ECMAScript 3rd edition. RFC 4627 registered its media type in July 2006. Today RFC 8259 is the IETF definition and ECMA-404, whose second edition dates from December 2017, defines the syntax; Ecma also lists it as ISO/IEC 21778.
Two properties explain why the relatives exist. The grammar has no comments, no trailing commas and only one way to quote a string, which keeps parsers small and consistent. Those same limits frustrate people who maintain configuration by hand. A relative that adds features gains comfort and loses the guarantee that every JSON tool can read the file. The comparison page covers that trade in detail.
JSONC, JWCC and HuJSON
JSONC: JSON with Comments
Microsoft introduced the format informally for VS Code files such as settings.json, launch.json and tasks.json, and published jsonc-parser to read them. The community draft at jsonc.org sets out to formalize what that parser accepts by default: JSON plus line and block comments. Trailing commas are optional for parsers, because the reference parser rejects them unless allowTrailingComma is set. VS Code accepts them in its JSON with Comments mode and shows a warning, except in files whose schema allows them.
The ambiguity matters in practice. "JSONC" in one tool tolerates a trailing comma and in another does not, and many JSONC files keep the .json extension. The draft recommends .jsonc, or an editor mode line when .json cannot be avoided.
JWCC: JSON With Commas and Comments
Nigel Tao proposed the name in February 2021 to give a repeatedly reinvented idea a searchable label. The definition has exactly two additions: an optional comma after the final element or member, and C-style comments. It leaves out NaN and infinities so that JWCC and JSON share one data model and converting back stays trivial. Single-quoted and multi-line strings were considered and rejected to keep the change small, and the author calls unquoted strings a mistake. Tailscale's hujson package for Go, short for "Human JSON", implements it and includes a formatter.
Are these subsets of JSON5?
For ordinary files, yes: every construct they add also exists in JSON5. The edge worth knowing is where a line comment ends. JSON5 ends a // comment at any ECMAScript line terminator, which includes a carriage return and the Unicode separators U+2028 and U+2029, not only a newline. The JWCC definition ends it only at a newline byte and says carriage returns are irrelevant. In our test a document with U+2028 inside a line comment parsed with jsonc-parser 3.3.1 and raised a syntax error in json5 2.2.3, because the rest of the "comment" became code.
Where JSON5 Sits
JSON5 occupies the middle of the range. It goes well past comments, yet it draws every addition from one fixed edition of one language. The specification calls it a proposed extension to JSON that adds minimal syntax directly from ECMAScript 5.1: identifier keys, trailing commas, single-quoted and continued strings, extra escapes, hexadecimal numbers, leading and trailing decimal points, Infinity, NaN, an explicit plus sign, comments and more white space. The reference project states that it will never add features that break compatibility with ES5.
That boundary was tested in public. Issue 190 in the reference repository, opened in February 2019 and titled "Should we consolidate the human-readable JSON efforts?", drew 72 comments. Maintainer Jordan Tucker wrote there that "JSON5 syntax will never go beyond the syntax of ES5." The thread closed without a merger of the formats.
The practical result is a format with a numbered specification, a separate test suite and parsers in many languages, listed in the implementations directory. What it leaves out, and why, is covered in Design Rationale; the exact productions are in the grammar reference.
Hjson, HOCON and CSON
Hjson
Hjson calls itself a syntax extension to JSON, meant as a user interface that people edit before the data reaches a machine, and not as a replacement for JSON. It allows #, // and block comments, optional commas, unquoted keys, strings with no quotes at all, triple-quoted multi-line strings and omitted root braces. Its history page records the first draft on March 19, 2014 and single-quoted strings in July 2017, and its home page says the project is now entirely community-supported.
Quoteless strings are the defining choice. A value runs to the end of the line, so name: two words is a string with a space, and a comma or # on that line becomes part of the text.
# Hjson
{
name: my service
rate: 1000
banner:
'''
First line.
Second line.
'''
}HOCON
Human-Optimized Config Object Notation comes from the Lightbend configuration library for JVM languages. It keeps the JSON tree and types but adds what applications need from configuration: # and // comments, = as an alternative to :, omitted root braces, newline separators, object merging, ${path} substitutions, environment variable fallback and include statements. Its own document notes that it is significantly harder to specify and parse than JSON, because it moves work from the person to the program.
# HOCON
base { host = localhost, port = 8080 }
admin = ${base} { port = 9090 }
include "overrides.conf"CSON
CoffeeScript Object Notation is JSON's counterpart for CoffeeScript literals: # comments, significant indentation, optional commas and braces, and triple-quoted strings. The safe parser distributed as cson-parser comes from Groupon, and the cson package wraps it. The Atom editor used CSON for its configuration files apart from the style sheet and init script, as its Flight Manual records. cson-parser rejected // comments in our probes, so a commented JSON5 file is not valid CSON.
Beyond ES5: JSONext, JSON6 and JSOX
JSONext, the experiment that stayed small
Jordan Tucker, who wrote the JSON5 specification, published JSONext as an "ext" of JSON with "next" generation features, and described it in issue 190 as a proof of concept. It accepts JSON5 syntax plus later ECMAScript additions such as code point escapes and template literals without substitutions, and it warns that Infinity and NaN are deprecated. Its npm package reached 1.1.0 in September 2017, the same month as the last push to the repository.
JSON6
d3x0r/JSON6 describes itself as a proposed extension to JSON that borrows from ECMAScript 6, and says plainly that it is not an official successor to JSON. Its README lists these additions over JSON5:
- The
undefinedkeyword and empty array members such as[1,,2]. - Backtick strings without template substitution, and unquoted keys with punctuation such as
content-type. - Strings that span lines with the newlines preserved, plus
\u{...}escapes. - Underscore digit separators,
0band0onumbers, leading zeros and repeated minus signs. - A streaming reader, and an opt-in
esStrictCompatiblemode that narrows the grammar.
The json-6 package also exports a stringify function. In our run it accepted all 81 valid files in the official JSON5 test suite and produced the same JSON serialization as the reference library for each. Accepting more is still a difference: 010 is a syntax error in JSON5 and the number 10 in json-6 1.1.7.
Full JSON6 reference: JSON6.dev, our sister site, covers JSON6 in depth: its syntax, the json-6 parser, guides and a comparison with JSON5.
JSOX
JSOX, the JavaScript Object eXchange format by the same author, builds on JSON6 and adds what JSON data models lack: BigInt, dates, binary typed arrays, user-defined tagged types, field-name macros that shrink repeated records, and references that allow shared and cyclic structures. Its README warns that JSOX.stringify output cannot be read by JSON.parse.
About the Internet-Draft: draft-buckeyne-jsox-format was posted on August 31, 2026 as an individual submission with intended status Informational; revision 01 followed. Anyone may submit an Internet-Draft. The datatracker states that this one is not endorsed by the IETF and has no formal standing.
JSONL and NDJSON Are a Different Thing
Full JSONL and NDJSON references: our sister sites JSONL.rest and NDJSON.com cover each format in depth, with guides, examples and a validator.
The names look like more relatives, but these conventions change nothing inside a JSON value. They say how to put many values in one file or stream so a program can read them one at a time. JSON Lines and NDJSON in particular are effectively two names for the same format: one JSON value per line, separated by a newline; see how they differ. The NDJSON specification repository dates from July 2013 and the JSON Lines documentation repository from October 2013.
| Convention | Record separator | Media type and extension |
|---|---|---|
| JSON Lines | Newline; each line is one JSON value in UTF-8 without a byte order mark | .jsonl; application/jsonl suggested and not standardized |
| NDJSON 1.0.0 | Newline, optionally preceded by a carriage return; each text conforms to RFC 8259 and contains no newline or carriage return | .ndjson; application/x-ndjson |
| JSON Text Sequences | Each text prefixed with the record separator U+001E | application/json-seq, registered by RFC 7464 |
{"id":1,"event":"start"}
{"id":2,"event":"stop"}Putting JSON5 in a line-delimited file is outside these specifications. JSON5 allows newlines inside block comments and between tokens, so splitting on line breaks is unsafe unless the producer guarantees one value per line. For large inputs, see the streaming tutorial.
One File, Many Parsers
Here is an ordinary JSON5 document. We gave the same bytes to each JavaScript parser.
{
// port the service listens on
port: 0x1F90,
host: 'localhost',
tags: ['a', 'b',],
}| Parser | Result |
|---|---|
json5, json-6, jsox | {"port":8080,"host":"localhost","tags":["a","b"]} |
hjson | {"port":"0x1F90,","host":"localhost","tags":["a","b"]} with no error |
JSON.parse | Syntax error at the comment |
jsonc-parser, trailing commas allowed | Reports errors for the unquoted keys, hex number and single quotes |
cson-parser | Syntax error at // |
A silent type change is worse than an error. The port became a string with a comma in it. Across the official JSON5 test suite, hjson 3.2.2 accepted 75 of the 81 valid files, and 26 of those 75 came out with different values, all of them number tests where it returned a string.
jsox 1.2.128 accepted 80 of the 81 and matched the reference serialization on those 80; the one rejection was a block comment containing asterisks. Large integers differ too: for 12345678901234567890 it returned an exact BigInt, while json5 and json-6 returned the rounded number 12345678901234567000. These are results for specific package versions, not statements about every implementation of a format.
How to Choose
Start with the software that will read the file, because its parser decides. If you control the reader, pick the smallest format that solves your problem.
| Your situation | Reasonable choice | Why |
|---|---|---|
| APIs and machine-to-machine messages | JSON | Universal support; JSON5's own README says it is not intended for this job |
| Files read by VS Code or TypeScript tooling | Whatever the tool documents, usually JSONC | The reader is fixed |
| Config that must convert back to JSON without loss | JWCC or JSONC | No new value types such as NaN |
| Hand-written config in a program you control | JSON5 | Comfort with a numbered specification and wide library support |
| JVM service needing includes and environment overrides | HOCON | Those are language features there |
| Prose-heavy settings edited by non-programmers | Hjson, with a schema | No quoting, at the price of implicit typing |
| Round-tripping dates, BigInt or cycles between JavaScript peers | Evaluate JSOX carefully | Few implementations; draft only |
| Logs and record streams | JSON Lines or NDJSON | One strict value per line |
- Give the file the extension of its real format, so editors and reviewers apply the right rules.
- Pin one parser and parse every config file in CI.
- Validate the parsed data with a schema; a format cannot catch a wrong type for you.
- Before switching, follow the migration tutorial.
Common Questions
Is JSON5 version 5 of JSON?
No. JSON has no version 5. The number refers to ECMAScript 5.1, the language edition the extra syntax comes from.
Is there a JSON6?
Yes, as an independent proposal at github.com/d3x0r/JSON6. It is not issued by the JSON5 project and it is not a standard.
Can a JSON5 parser read a JSONC file?
Yes for normal documents, since comments and trailing commas are part of JSON5. The reverse fails as soon as the file uses unquoted keys or single quotes.
Is YAML part of this family?
YAML has its own specification and syntax, so we leave it out. The comparison page sets it beside JSON5 and TOML.
Which relative is an official standard?
Only JSON itself, plus the RFC 7464 framing for sequences. The rest are community documents, library behavior or individual drafts.
Sources
(33)
- RFC 8259, The JSON Data Interchange Format
- RFC 4627, The application/json Media Type
- ECMA-404, The JSON data interchange syntax
- Wikipedia: JSON
- IANA application media types registry
- JSONC Specification (draft)
- JSONC-org/JSONC repository
- Visual Studio Code: JSON editing
- jsonc-parser on npm
- Nigel Tao: JSON With Commas and Comments
- tailscale/hujson
- The JSON5 Data Interchange Format 1.0.0
- json5/json5 reference implementation and README
- json5/json5 issue 190
- json5/json5-tests
- Hjson home
- Hjson syntax
- Hjson history
- Hjson Internet-Draft (2016)
- HOCON specification
- bevry/cson
- Atom Flight Manual: Basic Customization
- cson-parser on npm
- jordanbtucker/jsonext
- d3x0r/JSON6
- JSON6.dev, our sister reference site for JSON6
- d3x0r/JSOX
- IETF datatracker: draft-buckeyne-jsox-format
- JSON Lines
- NDJSON specification
- JSONL.rest, our sister reference site for JSON Lines
- NDJSON.com, our sister reference site for NDJSON
- RFC 7464, JSON Text Sequences
Last reviewed: November 29, 2026.
JavaScript
Python
TypeScript
Node.js
Rust
Java
C#
Ruby
Kotlin
Lua
Babel
Vite
webpack
ESLint
Prettier
VS Code
JetBrains