TOON cheat sheet

Everything below round-trips losslessly to JSON — paste any snippet into the TOON to JSON converter to see the equivalent.

Objects

name: Ada
active: true
score: 99.5
note: null

# nested object = indentation (2 spaces)
address:
  city: London
  zip: "12345"   # quote strings that look like numbers

Tabular arrays (TOON's superpower)

users[3]{id,name,role}:
  1,Ada,admin
  2,Alan,user
  3,Grace,user

# [3]        = declared row count (models can self-check)
# {id,...}   = field header, declared once
# rows       = CSV-style values in header order

Primitive arrays

tags[3]: alpha,beta,gamma
empty[0]:
mixed[2]:          # non-uniform arrays fall back to list form
  - 42
  - text

Quoting

plain: no quotes needed for simple strings
comma: "a, b"      # quote when the value contains the delimiter
colonish: "a: b"   # or a colon
numlike: "007"     # or would parse as a number/boolean

Options that change the output

  • Delimiter — comma (default), tab or pipe for table rows. Tab often tokenizes smallest; test with your data.
  • Key folding — collapses single-key chains: a: { b: { c: 1 } } becomes a.b.c: 1.

Gotchas

  • Indentation is structure — exactly like YAML, tabs vs spaces matter.
  • The row count in [n] must match the actual rows.
  • Rows must have exactly the fields declared in the header.

Full grammar lives in the official spec. For a narrative introduction, read What is TOON?