.toml · application/toml

TOML: Tom's Obvious, Minimal Language

TOML v1.0 maps unambiguously to hash tables using INI-style [section] headers, explicit quotes for strings, native datetimes, and # comments.

Quick Answer: TOML v1.0 maps unambiguously to hash tables using INI-style [section] headers, explicit quotes for strings, native datetimes, and # comments. Rust Cargo.toml, Python pyproject.toml, Hugo/Netlify configs, and typed app settings.

Structure typeHierarchical
Human readabilityHigh
Nesting supportYes
LLM token efficiencyMedium
File extension.toml
MIME typeapplication/toml
Best forRust Cargo.toml, Python pyproject.toml, Hugo/Netlify configs, and typed app settings.

Strengths

  • Eliminates YAML's indentation fragility and implicit boolean traps
  • Supports comments, native RFC 3339 timestamps, and clean dotted keys
  • Standard configuration format across Rust, Python packaging, and CLI tools

Trade-offs

  • Deeply nested arrays of objects become verbose compared to JSON or YAML
  • Requires explicit root tables when converting arrays at the top level
  • Less native parser support in standard libraries than JSON

References

Convert & clean TOML locally

Related engineering guides

Related Formats

All 24 formats

TOML frequently asked questions

Why do Cargo and pyproject.toml use TOML instead of YAML?

TOML forbids unquoted strings and indentation magic, ensuring package manifests parse identically everywhere with comments intact.

Can TOML represent a top-level JSON array directly?

No. A TOML root document must be a key-value table, so top-level JSON arrays are typically wrapped under an items or root key.

Is TOML compatible with INI files?

TOML borrows [section] syntax from INI but adds a formal v1.0 spec with typed integers, floats, booleans, arrays, and inline tables.