Runs 100% in your browser — nothing is uploaded
Formatters & Minifiers

TOML Formatter / Validator

Validate and consistently reformat TOML config files — using @iarna/toml, entirely client-side.

TOML Formatter / Validator
Client-side

About this tool

The TOML Formatter & Validator parses TOML documents and re-serializes them into a consistently formatted representation, surfacing syntax errors with the exact line and column where parsing failed. TOML (Tom's Obvious, Minimal Language) is the configuration format behind Cargo.toml (Rust), pyproject.toml (Python), and countless CLI tool configs precisely because it aims to be unambiguous — but its strict typing and table syntax still trip up hand-edited files.

This tool uses @iarna/toml, a widely used spec-compliant TOML parser and serializer, running entirely in your browser. Paste a TOML document and it is parsed into a structured value, then re-emitted in a normalized style: consistent table headers, quoting, and array formatting. If the input is invalid — an unclosed string, a duplicate key, a malformed array of tables — the error message reports the reason along with the line and column, so you don't have to scan the whole file to find the problem.

Because parsing and formatting happen entirely client-side, this tool is safe for TOML files containing internal package metadata, private registry URLs, or other non-public configuration — nothing leaves your browser tab. Common uses: validating a Cargo.toml before a build, formatting a pyproject.toml consistently across a team, or debugging a "duplicate key" or "invalid TOML" error thrown by a build tool.

FAQ

Does this tool send my TOML file to a server?
No. Parsing and formatting run entirely in your browser using the @iarna/toml JavaScript library. No network request is made as part of formatting.
Why do I get a "duplicate key" error?
TOML disallows defining the same key twice within the same table, even if the values are identical. Check for a key that appears twice under the same [table] header or at the top level.
Does formatting preserve comments?
No — like most TOML parser/serializer round-trips, comments are not retained because the parser converts the document into a plain data structure before re-emitting it.
What TOML version does this support?
@iarna/toml implements the TOML 0.5-era specification (compatible with 1.0 for the vast majority of real-world files), including tables, arrays of tables, inline tables, and all basic and literal string types.
Can I convert TOML to JSON?
This tool keeps the output as TOML. For a TOML-to-JSON or TOML-to-YAML conversion, pair it with the JSON Formatter or YAML Formatter tools.