TOML Formatter
Format and beautify your TOML configuration files
Input TOML
Formatted TOML
What is TOML Formatter?
Need to format and beautify your TOML (Tom's Obvious, Minimal Language) configuration files? TOML Formatter takes your TOML and formats it with consistent spacing, indentation, and structure. Perfect for cleaning up messy TOML files or ensuring consistent formatting across your configuration files. Learn more about TOML on Wikipedia.
According to the TOML v1.0.0 specification, TOML is a configuration file format that's easy to read and write. It's used by many modern tools like Cargo (Rust), Poetry (Python), and others. Proper formatting makes TOML files more readable and maintainable. Explore the official TOML GitHub repository for more details.
Everything happens in your browser – your TOML never leaves your computer. Format, download, and use your formatted TOML right away.
What Makes This Tool Different
Consistent Formatting
Formats TOML with consistent spacing and indentation. Makes your TOML files cleaner and easier to read.
Keeps Your Values
Keys, strings, numbers, dates and 64-bit integers come out with the same values. Comments are not kept, and inline tables are expanded into [section] form, because the file is rebuilt from its parsed data.
Real-Time Preview
See formatted TOML instantly as you type or paste. No waiting, no delays – immediate results.
File Upload Support
Upload TOML files directly. No need to copy-paste – just select your .toml file.
Download Formatted
One click to download your formatted TOML file. Drop it into your project and use it immediately.
Standards Compliant
Follows TOML v1.0.0 specification. Formatted TOML is valid and works with any TOML parser.
How It Works
Paste or Upload TOML
Paste your TOML into the left editor, or click "Upload" to load a file. You can also click "Sample" to see an example. The TOML should follow standard TOML syntax.
View Formatted Output
Your TOML is automatically formatted on the right. The formatted output appears instantly with consistent spacing and structure.
Copy or Download
Hit "Copy" for the clipboard or "Download" for a .toml file, and drop the tidied result straight back into your project.
When You'd Actually Use This
Clean Up Files
Format messy TOML files with inconsistent spacing. Make them clean and readable. Perfect for cleaning up legacy configuration files.
Team Consistency
Format TOML files to match your team's style guide. Consistent formatting makes code reviews easier and reduces merge conflicts.
Version Control
Format TOML before committing to version control. Consistent formatting makes diffs cleaner and easier to review.
Configuration Files
Format TOML configuration files for better readability. Clean, consistent formatting makes configuration easier to maintain.
Common Questions
Is my TOML data stored?
Nope. Everything happens right in your browser. Your TOML never leaves your computer – we don't even see it.
What does formatting change?
Spacing around =, blank lines between tables, and layout: inline tables like serde = { version = "1.0" } are rewritten as a [dependencies.serde] section, and arrays are written on one line. Times are written with milliseconds (07:32:00 becomes 07:32:00.000), which is the same value.
Does it preserve my content?
Your values, yes. Your comments, no: the formatter parses the TOML and writes it back out, and comments aren't part of the parsed data, so # pinned for MSRV notes disappear. If your Cargo.toml or pyproject.toml relies on comments, copy only the section you want reformatted, or keep the original next to it.
What TOML features are supported?
We support standard TOML syntax including tables, arrays, strings, numbers, booleans, dates, and more. Follows TOML v1.0.0 specification.
Does it work with large TOML files?
Yep. Since everything happens in your browser, it depends on your device. Small to medium TOML files format instantly. Really huge files might take a few seconds.
Is the formatted TOML valid?
Yes! The formatted TOML follows TOML v1.0.0 specification and is valid TOML. It works with any TOML parser.
Other TOML Tools You Might Need
Formatting is just one TOML task. Here are other tools that work well together: