| Type | Example | Notes |
|---|---|---|
| String (basic) | name = "Alice" | Supports \n, \t, \uXXXX escapes |
| String (literal) | path = 'C:\Users\Alice' | No escape processing β use for regex, paths |
| Multi-line string | desc = \"\"\" Line 1 Line 2\"\"\"`` | Opening newline trimmed |
| Integer | count = 42 hex = 0xFF bin = 0b1010 | Underscores allowed: 1_000_000 |
| Float | pi = 3.14159 sci = 5e22 inf = inf | nan also valid |
| Boolean | debug = true verbose = false | Always lowercase |
| Offset Date-Time | created = 1979-05-27T07:32:00Z | RFC 3339 / ISO 8601 |
| Local Date | date = 2024-01-15 | No time, no timezone |
| Array | tags = ["rust", "config"] | Mixed types allowed; multi-line OK |
| Inline Table | point = {x = 1, y = 2} | Must be on a single line |
| Table | [server] host = 'localhost' | Maps to nested object |
| Array of Tables | [[users]] name = 'Alice' | Creates an array of objects |
| Feature | TOML | JSON | YAML |
|---|---|---|---|
| Comments | β | β | β |
| Trailing commas | N/A | β | N/A |
| Native dates | β | β | β |
| Multi-line strings | β | β (escape \n) | β |
| Implicit type coercion | β | β | β (risky) |
| Human readability | High | Medium | High |
| Machine readability | High | High | Medium |
| Use case | Config files | APIs / data exchange | Config / automation |
Paste TOML into the input and use Validate to check its syntax without generating output. Choose Format when you want the parsed configuration serialized as TOML, or choose To JSON for a JSON representation. The example below converts one string property and shows the complete JSON result. Copy the output from the result panel after checking that the values have the expected types.
Choose From JSON only when the input panel contains JSON rather than TOML. Formatting parses and serializes data, so comments and original presentation do not survive as an exact source copy. Date and time values also need attention when moving between formats with different type systems. Keep the original configuration and test the converted document in its destination application before replacing an existing settings file.
TOML input: name = "Ada"
To JSON output:
{
"name": "Ada"
}
TOML (Tom's Obvious, Minimal Language) is a configuration file format designed to be easy to read due to obvious semantics. It maps unambiguously to a hash table and is designed as an alternative to YAML and JSON for configuration files. TOML is used by Rust's Cargo, Python's Poetry, and many other tools.
Unlike JSON, TOML supports comments, multi-line strings, and has native date/time types. Unlike YAML, TOML has explicit, unambiguous syntax β there are no surprising implicit type coercions or indentation pitfalls. TOML is generally preferred for configuration files while JSON is preferred for data exchange APIs.
A TOML table is defined with [table.name] syntax and maps to a nested object. An array of tables uses [[array.name]] (double brackets) and creates an array of objects. Inline tables use {key = value} syntax for compact representations. Tables support arbitrary nesting for hierarchical configuration.
TOML supports: String (basic and literal/raw), Integer (decimal, hex 0x, octal 0o, binary 0b), Float (including inf and nan), Boolean (true/false), Offset Date-Time (RFC 3339), Local Date-Time, Local Date, Local Time, Array (mixed types allowed), and Table/Inline Table.