PureDevTools

TOML Formatter & Beautifier

Format TOML config files with proper indentation and table grouping — all in your browser, nothing sent to any server

All processing happens in your browser. No data is sent to any server.

A Cargo.toml with 50 dependencies, nested feature flags, and inline tables mixed with standard tables. Or a pyproject.toml with tool configurations spanning multiple sections. TOML is designed to be readable, but without consistent formatting, large config files become hard to navigate.

What Is a TOML Formatter?

A TOML formatter takes TOML (Tom’s Obvious Minimal Language) configuration files and restructures them with consistent indentation, proper table grouping, and aligned key-value pairs. TOML is used by Rust (Cargo.toml), Python (pyproject.toml), Hugo, Deno, and many other tools. A formatter ensures your config files are clean and scannable.

This tool supports:

TOML Structure and Formatting

TOML has a few key structural elements that benefit from consistent formatting:

Common Use Cases

Rust development: Cargo.toml is the central configuration for every Rust project. Format it to clearly separate [package], [dependencies], [dev-dependencies], [features], and [[bin]] sections.

Python project configuration: pyproject.toml contains build system requirements, tool configurations (Black, pytest, mypy), and project metadata. Formatting makes each tool’s section clearly delineated.

Hugo site configuration: Hugo static sites use config.toml for site settings, menu items, and theme parameters. Proper formatting reveals the configuration hierarchy.

CI/CD configuration: Tools like deno.json alternatives, Taplo, and various CI systems use TOML for configuration. Format before committing to keep configs clean.

Frequently Asked Questions

Does this formatter handle Cargo.toml specifically? Yes. All valid TOML is supported, including Cargo-specific patterns like [dependencies] with version strings, feature arrays, [workspace] members, and [profile.release] optimization settings.

Can it handle inline tables and arrays? Yes. Inline tables ({ key = "value" }) and multi-line arrays are formatted with proper spacing. The formatter preserves your choice of inline vs. expanded format.

Does it validate TOML syntax? The formatter checks for basic structural correctness — unclosed strings, mismatched brackets, and invalid key-value pairs. It does not validate against a specific schema.

Is my TOML data sent to a server? No. All formatting runs entirely in your browser. No configuration data is transmitted anywhere. Your files never leave your device.

Related Tools

More Code Formatters