Skip to content
uencoder

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"
    Output
    The table {owner:{name:"Ada"}}

    Explicit types

Common errors

Expecting TOML but writing YAML-style indentation
TOML uses table headers, not indentation

Related terms

Related tools

References