EMZETT.
Login

File formats for configuration and data (YAML, JSON, XML, TOML, CSV)

In short: For settings and data there are readable text formats. The most important: YAML (.yml), JSON, XML, TOML, INI and CSV. They differ in readability, feature set and strictness.

In more detail: All are plain text and can be opened with any editor. Which one fits depends on the use: configuration for humans (YAML, TOML), data exchange between programs (JSON, XML), tables (CSV).

In detail

  • YAML: indentation instead of brackets, comments with #, popular for CI and Docker, see YAML. Indentation errors are common, tabs are forbidden.
  • JSON: strict, keys in quotes, no comments. Standard for web APIs.
  • XML: nested tags, checkable against a schema, verbose. Common in older systems, SVG, office files.
  • TOML: like INI but with types, used by Rust (Cargo.toml) and Python (pyproject.toml).
  • INI: simple sections with key=value.
  • CSV: table with separator (comma or semicolon), no types, no nesting. Excel in Germany often uses a semicolon.
  • Binary formats: Protobuf, MessagePack, Parquet are more compact but not directly readable.
  • Choice: for humans prefer YAML/TOML, for machines JSON.

See also: YAML, GitLab