TOML Formatter

Paste TOML configuration files to format, validate, and inspect them locally in your browser.

Paste TOML content or load a sample to begin.

TOML input

Paste Cargo.toml, pyproject.toml, application settings, or other TOML configuration text.

Processed locally in your browser Limit 5 MB. Your input is processed in your browser and is not uploaded or sent to a server. Avoid pasting production secrets, access tokens, private keys, passwords, or sensitive customer data unless you understand the risk.

Formatted TOML

Formatted TOML appears after validation.

TOML validation

Syntax, structure, and formatting report

Validate TOML to see table counts, keys, arrays, syntax errors, warnings, and formatted output.

TOML Guide

Format readable configuration files

TOML is common in Rust, Python, build tools, and application settings where predictable configuration syntax matters.

TOML syntax

TOML uses key-value pairs, tables, arrays, inline tables, arrays of tables, dotted keys, strings, numbers, booleans, and date/time values. The validator parses these structures before formatting.

TOML vs YAML vs JSON

JSON is strict data interchange, YAML is flexible and indentation-sensitive, and TOML is designed for configuration files with explicit tables and simple values.

Common mistakes

Duplicate tables, unfinished inline tables, trailing separators in the wrong place, invalid strings, and mixed array types are frequent causes of TOML syntax errors.

Cargo.toml

Rust projects use Cargo.toml for package metadata, dependencies, profiles, workspaces, features, and build settings. Formatting helps keep dependency blocks easy to review.

pyproject.toml

Python projects use pyproject.toml for build systems, project metadata, dependency groups, pytest, Ruff, mypy, Black, and other tooling configuration.

Formatting behavior

Formatting normalizes TOML from the parsed structure. Comments and original spacing may not be preserved, so review the output before replacing hand-edited files.

TOML Formatter FAQ

Does this execute TOML values?

No. TOML is treated as configuration text only. The tool does not run commands, evaluate expressions, load referenced files, or resolve environment variables.

Does it support TOML 1.0 syntax?

Yes. It supports TOML syntax used for tables, arrays, inline tables, arrays of tables, dotted keys, strings, numbers, booleans, and dates or times where practical in the browser.

Are comments preserved?

Comments may not be preserved after formatting because the output is generated from the parsed TOML structure.

Can I validate Cargo.toml and pyproject.toml?

Yes. Use the samples or paste those files directly to validate TOML syntax and produce readable formatted output.