JSON Comments: Why They Don't Exist & Workarounds
JSON does not support comments by design. Here are the best workarounds: JSONC, JSON5, YAML conversion, and the _comment convention.
Why JSON Has No Comments
Douglas Crockford (JSON creator) intentionally removed comments because they were being used for parsing directives, which violated JSON's goal of being a simple data format.
Workarounds
- JSONC: JSON with Comments — used by VS Code's settings.json
- JSON5: Superset allowing comments, trailing commas, unquoted keys
- YAML: Full comment support with
#. Convert with our JSON/YAML Converter - Convention: Use
"_comment"or"//"keys for inline documentation
Try It Free
Use our free online tool — 100% client-side, no data leaves your browser.
Open JSON/YAML Converter