TOML Formatter
Format, minify, and validate TOML configuration files
Input TOML
Formatted TOML
What Is the TOML Formatter?
TOML (Tom's Obvious Minimal Language) is a config format for Cargo, Poetry, and many tools. The TOML Formatter adds indentation and line breaks to raw or minified TOML. The TOML spec defines the syntax.
This tool runs entirely in your browser. Nothing is sent to a server. Paste TOML or upload a file; get formatted output. For validation, use TOML Validator. For conversion to JSON, use TOML to JSON. For JSON to TOML, use JSON to TOML.
TOML Formatting Examples
Format TOML for consistent spacing. Telecom-themed example:
Example: Subscriber config
Formatted output:
Click the Sample button above to load more examples into the editor.
How to Use This Tool
Paste or Upload
Paste TOML into the left panel or upload a .toml file. Use Sample to load example config. Use Clear to reset.
Check the Output
The right panel shows formatted TOML with proper indentation. Invalid TOML will show an error.
Copy or Download
Use Copy or Download to get the result. For conversion, use TOML to JSON, TOML to YAML, or TOML to XML.
When the TOML Formatter Helps
When editing Cargo.toml (Rust), pyproject.toml (Poetry), or other config files, formatting makes structure clear. Great for debugging, code review, and readability. For validation before committing, use TOML Validator.
Frequently Asked Questions
Is my data private?
Yes. Formatting runs entirely in your browser. No data is sent to any server.
Does it support TOML 1.0?
Yes. The tool supports the TOML 1.0 specification including tables, arrays, and inline tables.
Formatter vs Validator?
Formatter reformats valid TOML. Validator checks syntax and reports errors. Use both for quality.
Can I minify TOML?
TOML is typically kept readable for config. For minification, you would need a custom approach or conversion to JSON first.
What about comments?
Comments are preserved during formatting. The structure is reindented for clarity.