2026-11-28

indent data

an indentation-based data serialization format with the same data model as json. designed for configuration files and other human-edited structured data. whitespace separates keys and values, indentation defines nesting, and a colon marks arrays.

example:

name "example"
enabled true
server
  host "localhost"
  port 8080
paths: "/home" "/backup"
excludes:
  "/.git/"
  "/node_modules/"
users:
  .
    name "alice"
    enabled true
  .
    name "bob"
    enabled false
matrix:
  : 1 2 3
  : 4 5 6

syntax:

  • a key followed by a scalar value defines an association
  • a key without a value defines an object containing the subordinate lines
  • a key followed immediately by a colon defines an array. elements can follow on the same line or on subordinate lines
  • within arrays, a period introduces an anonymous object and a colon introduces an anonymous array
  • objects and arrays without content are empty
  • scalar values use json syntax
  • unquoted keys consist of ascii letters, digits, underscores and hyphens, starting with a letter or underscore. arbitrary keys can be expressed as json strings
  • a hash (#) outside a quoted string starts a comment extending to the end of the line
  • empty lines and comments do not affect structure

the root object is implicit. a root array is introduced by a colon, a root scalar by a period followed by its value, and an empty root object by a period on its own.

indentation uses spaces and defaults to a width of two. indentation depth is calculated by dividing the number of leading spaces by the indentation width and rounding up. the width can be configured externally. indentation may increase by at most one level at a time and decrease by any number of levels.

duplicate object keys, invalid literals, invalid nesting and empty documents are invalid.

benefits

  • represents arbitrary json data
  • low syntactic noise and high information density
  • no structural closing delimiters or element separators
  • compact representation of arrays with few elements
  • supports comments
  • independent of programming language syntax

drawbacks

  • anonymous containers require additional markers