TOML Syntax Reference

TOML v1.0 tables, arrays, inline tables, dates and value types explained.

Searchable TOML v1.0.0 syntax reference covering bare and quoted keys, dotted keys, tables, arrays of tables, every string variant, number formats and the four RFC 3339 date-time types.

What is an array of tables in TOML?

Double square brackets like [[products]] append a new table to an array each time they appear. Repeating the header three times builds an array of three table objects, which is how TOML expresses a list of structured records.

A tour of TOML v1.0.0 syntax

TOML (Tom’s Obvious, Minimal Language) is a configuration format designed to be easy to read and to map cleanly onto a hash table. It powers Cargo.toml, pyproject.toml and many other tool configs. This reference covers keys and tables, every string variant, number formats, arrays and the four date-time types.

How it works

A TOML file is a set of key/value pairs grouped into tables. A header in square brackets opens a table; dotted names create nesting; double brackets build an array of tables:

title = "Example"

[server]
host = "127.0.0.1"
ports = [80, 443]
tls = { enabled = true, min = "1.2" }

[[products]]
name = "A"
[[products]]
name = "B"

created = 1979-05-27T07:32:00Z

Every value has a clear type: integers (with _ separators and 0x/0o/0b prefixes), floats, booleans (true/false only), strings in four flavours, arrays, and the RFC 3339 temporal types. Files must be valid UTF-8.

Tips and notes

  • Use literal strings (single quotes) for Windows paths and regex to avoid escaping.
  • [[name]] appends to an array of tables; plain [name] defines a single table.
  • Booleans are lowercase only; there is no True or yes.
  • Defining the same key twice is an error — that strictness prevents silent overrides.