TOML (Tom's Obvious Minimal Language) is a configuration format designed to be unambiguous to read and to map onto a hash table. It is used by pyproject.toml, Cargo.toml and many tools. Convert between formats with the TOML to JSON Converter and the JSON to TOML Converter.
A complete example
# A comment
title = "Example"
count = 42
ratio = 3.14
enabled = true
released = 2026-10-28
updated = 2026-10-28T07:32:00Z
tags = ["a", "b", "c"]
products = [
{ name = "Hammer", sku = 738594937 },
{ name = "Nail", sku = 284758393 },
]
[server]
host = "localhost"
port = 8080
[server.tls]
enabled = false
Value types
| Type | Examples |
|---|---|
| String | "basic" (escapes allowed), 'literal' (no escapes), """multi-line""", '''multi-line literal''' |
| Integer | 42, +17, -5, 1_000, 0xFF, 0o17, 0b101 |
| Float | 3.14, -0.01, 6.626e-34, +inf, -inf, nan |
| Boolean | true, false (lowercase only) |
| Offset date-time | 2026-10-28T07:32:00Z or 2026-10-28T07:32:00+02:00 |
| Local date-time | 2026-10-28T07:32:00 (no zone) |
| Local date | 2026-10-28 |
| Local time | 07:32:00 |
| Array | [1, 2, 3], may span lines and have a trailing comma |
| Inline table | { a = 1, b = 2 } (one line) |
Tables, dotted keys and arrays of tables
- A
[table]header starts a section; every key below it belongs to that table until the next header. [a.b]defines tablebinsidea. The same key path can only be defined once.- Dotted keys such as
a.b.c = 1create nested tables without headers: the result is{"a": {"b": {"c": 1}}}. - A header with the name wrapped in doubled square brackets (two opening brackets, the name, two closing brackets, no spaces) appends a new table to an array of tables. Each repeated header adds one element; an array of inline tables, as in the example, does the same on one line.
Rules that trip people up
- Keys are case-sensitive and unquoted keys may only use
A-Za-z0-9_-. Quote anything else:"my key" = 1. - A key cannot be defined twice, and
[server]afterserver.port = 1is an error. - Integers have no leading zeros (
007is invalid) and floats need digits on both sides of the dot (.5and5.are invalid). - There is no
null. Leave the key out, or use an empty string or a documented sentinel. - Arrays may mix types in TOML 1.0, but most tools expect one type.
- Whitespace is not significant, unlike YAML, but a value must end its line.