TOML Formatter

Format and validate TOML with consistent structure and optional key sorting.

Input data is processed in your browser
Data is never sent to a server

Tool

0 chars

or drag & drop a file

What is TOML Formatter?

TOML Formatter reformats TOML into a clean, consistently structured output. It can also sort keys alphabetically and validates syntax in the process. Useful for tidying up Cargo.toml, pyproject.toml, Hugo configuration files, and other TOML-based project configs.

How to Use

  1. Paste TOML text into the input field.
  2. Click "Format" to pretty-print with consistent structure.
  3. Enable "Sort keys" to sort all keys alphabetically.
  4. Click "Copy Result" to copy to clipboard.

FAQ

Can it detect TOML syntax errors?

Yes. If you enter invalid TOML, a parse error message is displayed with the line number.

Are comments preserved?

No. Comments are removed during the parse and re-serialization process.

Does TOML support anchors or aliases like YAML?

No. TOML does not have anchor or alias features.

Is my data sent to a server?

No. All processing happens entirely in your browser.

Which TOML version is supported?

The formatter supports the main TOML v1.0 syntax including tables, array of tables, inline tables, multiline strings, and datetime literals.