Skip to content
uencoder

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: 36
    Output
    The 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

Related tools

References