No Login Data Private Local Save

TOML Formatter & Validator - Online Config Tool

11
0
0
0
Loading...
Input TOML
Ln 1, Col 1
Output

Frequently Asked Questions

TOML (Tom's Obvious, Minimal Language) is a configuration file format designed to be easy to read and write. Created by Tom Preston-Werner (co-founder of GitHub), TOML aims to be a minimal configuration format that maps unambiguously to a hash table. It's widely used in Rust projects (Cargo.toml), Python packaging (pyproject.toml), and many other ecosystems. TOML supports key-value pairs, tables (sections), arrays, nested structures, and multiple data types including dates, times, and booleans.

  • TOML: Best for configuration files. Clean, readable, supports comments, and has a clear spec. Great for humans editing config.
  • JSON: Best for data interchange between systems. No comments, stricter syntax, widely supported by APIs.
  • YAML: Powerful but complex. Supports references, anchors, and multiple styles. Indentation-sensitive — easy to make subtle errors.

Choose TOML when you want a simple, readable config format with minimal footguns.

  • Keys and values are separated by =
  • Keys are case-sensitive and can be bare (unquoted) or quoted ("key" or 'key')
  • Comments start with #
  • Tables (sections) are defined with [table-name]
  • Nested tables use dot notation: [parent.child]
  • Array of tables use double brackets: [[array-table]]
  • Strings support double quotes (with escapes) and single quotes (literal)
  • Multi-line strings use triple quotes """ or '''

TOML supports: String, Integer, Float, Boolean (true/false), Offset Date-Time (1979-05-27T07:32:00Z), Local Date-Time, Local Date, Local Time, Array ([1, 2, 3]), and Inline Table ({key = "val"}). This rich type system makes TOML more expressive than INI files while remaining simpler than YAML.

[table] defines a single table (a section). If you define it twice, the later definition overwrites the earlier one.

[[array-of-tables]] defines an array of tables. Each occurrence appends a new table to an array. This is perfect for defining multiple similar entries, like a list of servers, dependencies, or authors.
[[fruits]]
name = "apple"
[[fruits]]
name = "banana"
# Results in: fruits = [{name="apple"}, {name="banana"}]

  • Duplicate keys: Each key must be unique within its table. Check for accidental redeclaration.
  • Mixed table types: You can't use both [a] and [[a]] for the same name — choose one.
  • Missing equals sign: Every key-value pair needs =. key "value" is invalid.
  • Bare keys with special chars: If your key contains dots, spaces, or special characters, quote it: "my.key" = "val".
  • Array type mixing: All elements in a TOML array should be of the same type.
  • Invalid date format: Use ISO 8601 format for dates and times.

No. Like most TOML parsers, the underlying library parses TOML into data structures and then serializes back to text. During this round-trip, comments are not preserved. If you need comment-preserving formatting, consider using a dedicated TOML formatter like taplo (a Rust-based TOML toolkit) in your local development environment. Our online tool prioritizes validation accuracy and consistent output formatting.

  • Use bare keys (unquoted) for simple alphanumeric key names.
  • Add a blank line between tables for readability.
  • Use consistent quoting: double quotes for strings with escapes, single quotes for literal strings.
  • Keep line length under 100 characters for readability.
  • Use array of tables ([[...]]) for lists of similar objects.
  • Place root keys at the top before any [table] definitions.
  • Avoid deeply nested tables (more than 3-4 levels deep).