TOML (Tom's Obvious, Minimal Language) is a minimal configuration file format designed for human readability and unambiguous parsing. Created by Tom Preston-Werner in 2013 and formally specified in TOML 1.0 (2021) and TOML 1.1 (2025), it maps directly to hash tables and supports explicit data types β strings, integers, floats, booleans, datetimes, arrays, and tables. TOML occupies a middle ground between INI's simplicity and YAML's feature richness: it avoids INI's lack of formal specification and type support while sidestepping YAML's indentation sensitivity and implicit type coercion. Its adoption in pyproject.toml (Python), Cargo.toml (Rust), and countless modern tools reflects its balance of minimal syntax, strong typing, and predictable behavior β making it an excellent choice when configuration files must be both human-edited and machine-parsed reliably.
What This Cheat Sheet Covers
This topic spans 22 focused tables and 139 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Basic Data Types
| Type | Example | Description |
|---|---|---|
name = "Tom Preston-Werner" | β’ Enclosed in double quotes β’ supports escape sequences like \n, \t, \", \\, and Unicode escapes \uXXXX or \UXXXXXXXX | |
description = """Multi-linestrings allow line breaks.""" | β’ Triple double quotes β’ newlines in the value are preserved β’ line-ending backslash trims whitespace | |
path = 'C:\Users\new\docs' | β’ Single quotes β’ no escape sequences β what you see is what you get | |
regex = '''[0-9]{2,4}''' | β’ Triple single quotes β’ newlines preserved β’ no escapes β’ ideal for regex patterns or embedded code | |
port = 8080 | β’ 64-bit signed integers β’ underscores allowed for readability: large = 1_000_000 | |
color = 0xDEADBEEF | β’ Prefix 0xβ’ only non-negative integers |