JSON vs JSONC: comments are a contract choice
Understand the syntax and interoperability differences between JSON, JSONC, and JSON5.
5 minute read · Updated August 2026Open the tolerant parser →JSON is a data-interchange format
Strict JSON deliberately has a small grammar. JSONC layers line and block comments over that grammar, while JSON5 adds conveniences such as single quotes, unquoted keys, and trailing commas.
Use tolerant input, strict output
For local configuration, comments may be valuable. At an API boundary, strict JSON is the portable representation. A practical workflow parses tolerant input and exports explicit strict JSON when data leaves the authoring environment.
Comments cannot survive a generic JSON model
Once a JSONC document becomes ordinary key/value data, comments are not values and are usually discarded. Use a source-aware editor if comment preservation is a requirement.