TOML Formatter & Validator
Format, beautify, minify, sort, and validate TOML files. Perfect for Cargo.toml, pyproject.toml, Hugo config, and any TOML configuration file.
TOML Syntax Reference
| Construct | Syntax | Description |
|---|---|---|
| Key-Value | key = "value" | Basic assignment with = sign |
| Table | [table] | Section header / object |
| Dotted Key | server.port = 8080 | Nested key shorthand |
| Array of Tables | [[items]] | Repeated section creates array |
| String | "hello" | Basic string with escapes |
| Literal String | 'no\escapes' | Single-quoted, no escapes |
| Multiline String | """....""" | Triple-quoted multiline |
| Integer | port = 8080 | Decimal, hex (0x), octal (0o), binary (0b) |
| Float | pi = 3.14159 | IEEE 754 float, inf, nan |
| Boolean | enabled = true | true or false (lowercase) |
| Date-Time | 2024-01-15T10:30:00Z | RFC 3339 datetime |
| Array | ports = [80, 443] | Comma-separated list in brackets |
| Inline Table | {k = "v"} | Single-line table in braces |
| Comment | # comment | Hash to end of line |
Related Tools
Frequently Asked Questions
What is TOML?
TOML (Tom's Obvious Minimal Language) is a configuration file format designed to be easy to read and write. It's used by Rust's Cargo (Cargo.toml), Python's pyproject.toml, Hugo, and many other tools. It maps clearly to a hash table structure.
What's the difference between TOML and YAML?
TOML uses explicit section headers ([table]) and = for assignment, while YAML uses indentation. TOML doesn't have the 'Norway problem' (no implicit type coercion — booleans must be true/false). TOML is simpler but less flexible for deeply nested data. YAML supports anchors and aliases; TOML does not.
What does 'Align = signs' do?
When enabled, all key-value pairs within the same section are padded so their = signs line up vertically. This improves readability for tables with many keys of different lengths (common in Cargo.toml dependencies).
Is my data safe?
Yes. All formatting, sorting, and validation happens entirely in your browser using JavaScript. No data is sent to any server. Your TOML files never leave your machine.