Skip to content

TOML Formatter

Format TOML configuration files such as Cargo.toml, pyproject.toml and other app settings with the Prettier TOML plugin. The formatter normalizes spacing around equals signs, inline tables and arrays, separates tables with a blank line, keeps every comment and reports syntax errors with line and column, so developers can tidy configuration safely before committing it.

Reset

Frequently asked questions

Which engine formats TOML?

The tool uses Prettier 3 with prettier-plugin-toml 4.1 on the server. It reads TOML 1.0 documents and prints them in one consistent style.

What changes in the output?

Keys and values get one space around the equals sign and inline tables and arrays are spaced evenly. Extra blank lines are collapsed and every table header is separated from the previous section by a blank line.

Are comments kept?

Yes. Full-line comments and trailing comments after values stay where they were, so annotated configuration files keep their notes.

Will keys or tables be sorted?

No. Keys, tables and arrays of tables keep their original order, which matters for files that people read from top to bottom.

Can string quotes change?

Single-quoted literal strings may be rewritten with double quotes when the value contains no backslash or double quote, so the value stays the same. Strings that need literal quoting keep their single quotes.

How are long arrays handled?

Arrays that fit within the print width stay on one line. Arrays with a trailing comma or that exceed the width are printed with one element per line.

What happens with invalid TOML?

Formatting stops and the tool shows the parser's message with the line and column, for example a value missing after an equals sign. Duplicate keys and other invalid TOML are reported the same way.

Can I change the indentation?

Yes. Choose 2 or 4 spaces or tabs for nested arrays, and a print width from 40 to 200 characters with 80 as the default.

How large can the file be?

Up to 1 MB of text per request, which is far larger than typical configuration files. Formatting stops after 10 seconds.

Is my configuration stored?

No. Configuration files can contain secrets, so the content is processed in memory only and never saved or logged.

About OneClick Pro

OneClick Pro is a free collection of more than 150 web tools for everyday work: converting images and units, formatting and validating code, checking domains and SEO, and working with text, dates and numbers. Every tool runs without registration or subscription, and what you enter is only used to calculate your result and is never stored. Use it as a quick toolbox for one-off tasks, or bookmark the tools you rely on every day.