HJSON
HJSON (Human JSON) is a human-oriented JSON format that allows comments, unquoted keys and values, multiline strings, and trailing commas, emphasizing readability.
Purpose
To provide a format better suited than JSON for hand-written configuration while remaining convertible back to standard JSON.
Mechanism
It allows # and // comments, unquoted keys and string values, multiline strings, and trailing commas. Parsed output becomes standard JSON values. Its type inference is more conservative than YAML's.
Use cases
- Application configuration files
- Hand-maintained data
- Document frontmatter
- A simpler alternative to YAML
Examples
- Input
name: Ada age: 36OutputThe object {name:"Ada", age:36}Unquoted keys and values
Common errors
- HJSON parsers are less widespread than JSON parsers
- Confirm the target environment has an HJSON parser
Related terms
JSON
JSON (JavaScript Object Notation) is a lightweight data interchange format based on JavaScript object literals, using key-value pairs and arrays. GLOSSARY
JSON5
JSON5 is a superset of JSON that allows single quotes, unquoted keys, comments, trailing commas, NaN/Infinity, and hexadecimal numbers, making it better for hand-edited configuration. GLOSSARY
YAML
YAML (YAML Ain't Markup Language) is a configuration-oriented data serialization format using indentation for hierarchy, supporting comments and references, and better suited to hand editing than JSON. GLOSSARY
Related tools
Hjson Format
Hjson Format — pure client-side tool. Privacy-first, no server round-trip. TOOL
Hjson Validate
Hjson Validate — pure client-side tool. Privacy-first, no server round-trip. TOOL
HJSON Parser
HJSON Parser — pure client-side tool. Privacy-first, no server round-trip. TOOL
HJSON Stringify
HJSON Stringify — pure client-side tool. Privacy-first, no server round-trip. TOOL