TOML
TOML (Tom's Obvious, Minimal Language) is a configuration-oriented format representing data with tables and key-value pairs, with explicit semantics and no implicit type inference.
Purpose
To provide a format more explicit than YAML and better suited to configuration than JSON, avoiding YAML's type-inference pitfalls.
Mechanism
Tables are declared with [section] and key-value pairs with key = value. It supports strings, integers, floats, booleans, dates, arrays, and inline tables. No references and no multi-document streams; types are explicit. Rust's Cargo.toml and Python's pyproject.toml are the main users.
Use cases
- Rust Cargo.toml
- Python pyproject.toml
- Static site generator configuration
- Toolchain configuration
Examples
- Input
[owner] name = "Ada"OutputThe table {owner:{name:"Ada"}}Explicit types
Common errors
- Expecting TOML but writing YAML-style indentation
- TOML uses table headers, not indentation
Related terms
YAML
YAML (YAML Ain't Markup Language) is a configuration-oriented data serialization format using indentation for hierarchy, supporting comments and references, and better suited to hand editing than JSON. GLOSSARY
JSON
JSON (JavaScript Object Notation) is a lightweight data interchange format based on JavaScript object literals, using key-value pairs and arrays. GLOSSARY
INI
INI is a traditional configuration file format that groups settings with [section] headers and key=value pairs; it is simple but unstandardized, and implementations differ slightly. GLOSSARY