About the TOML Formatter & Validator
What is a TOML formatter and validator?
TOML is the config format behind Cargo.toml, pyproject.toml, and a growing pile of modern tooling — friendly to read, but still easy to break with a stray quote or a duplicate key. This tool parses your TOML against the v1.0 specification as you type: a green badge means the file is valid, a red one explains what's wrong. Valid input is re-emitted in normalized form — consistent spacing around =, canonical string quoting, and tables laid out section by section, with optional alphabetical key sorting.
The parser is the spec-compliant smol-toml library, bundled locally — nothing loads from a CDN and your configs stay in the browser. As with any parse-and-re-emit formatter, comments are not preserved in the normalized output; when you just need a verdict on validity, the badge alone answers it without touching your file.
How to Use This Tool
- Add your TOML. Paste it, open a
.tomlfile, or click Sample. - Read the badge. Valid TOML turns it green; errors show the parser's complaint in red.
- Take the normalized output. Optionally sort keys, then copy or download the clean file.
Common Use Cases
- Validating package configs: Check
Cargo.tomlorpyproject.tomledits before the build tool complains. - Debugging app configs: Find the typo that makes your service refuse to start.
- Normalizing style: Standardize spacing and quoting across hand-edited config files.
- Verifying generated TOML: Confirm that templated or scripted output is actually spec-valid.
Converting formats? Try INI to JSON or the JSON Formatter, or browse all our free developer tools.
Frequently Asked Questions
Which TOML version does it validate against?
TOML v1.0.0, the current stable specification, via the spec-compliant smol-toml parser. Dates, times, multi-line strings, dotted keys, inline tables, and arrays of tables are all supported.
Are comments kept in the formatted output?
No. The formatter parses your file into data and re-emits it, which drops comments — the unavoidable trade-off of parse-based normalization. Validation, however, never modifies your file, so you can use the badge alone for comment-heavy configs.
What does "normalized" output mean?
Consistent single spaces around =, canonical quoting for strings, one key per line, and tables emitted section by section. Semantically the file is identical to your input; it just has one predictable style.
Why did my duplicate key pass in another tool?
Duplicate keys are illegal in TOML v1.0, and this validator flags them. Some lenient parsers silently keep the last value, which hides real config mistakes.
Can it check just validity without reformatting?
Yes — the badge updates as you type regardless of whether you use the output. Green means the file parses under TOML v1.0; you can ignore the normalized version entirely.
Is my config private?
Yes. The parser is bundled with the page and everything runs locally in your browser — no CDN requests, no uploads, no logging — and it works offline once loaded.