Skip to main content
Home Tools TOML Formatter
🔧 Programming ✅ 100% Free ⚡ Instant

TOML Formatter

Format and beautify TOML configuration files. Normalises table headers, aligns key-value pairs, formats inline arrays, and ensures consistent spacing. Works with Cargo.toml, pyproject.toml, and any TOML config.

Indent:
📥 Input
📤 Output
Ready — paste code and click Format · Ctrl+Enter to format
Lines: — Size: —
Load example: ▶ Cargo ▶ Pyproject
📊 Stats
Lines
Size
💡 Quick Reference
[table]Table header
[[array]]Array of tables
key = "val"String value
2024-01-01Date literal
true/falseBoolean values

What is TOML?

TOML (Tom's Obvious Minimal Language) is a configuration file format created by Tom Preston-Werner (GitHub co-founder) in 2013. It is designed to be easy to read, with a minimal syntax that maps unambiguously to a hash table. TOML supports strings, integers, floats, booleans, datetime, arrays, and tables. It is the standard format for Rust's Cargo.toml, Python's pyproject.toml, Hugo's config, and many modern tools.

Frequently Asked Questions

TOML is simpler and less error-prone than YAML. YAML's whitespace-sensitivity, multiple ways to express the same thing, and surprising edge cases (like Norway being parsed as false because NO is a YAML boolean) make it fragile. TOML has a single, unambiguous syntax for each data type and doesn't rely on indentation for structure.
[table] defines a single table (a map of key-value pairs). [[array]] defines an element in an array of tables — each occurrence of [[array]] appends a new table to the array. This is TOML's way of representing a list of objects, equivalent to a JSON array of objects.
Yes. TOML uses # for comments, which extend to the end of the line. Unlike JSON (which has no comment support), TOML is designed for configuration files where comments explaining settings are important. Inline comments after values are also supported: port = 8080 # default HTTP port.
Done!