TOML Formatter & Validator

Format and validate TOML configuration files with canonical, easy-to-read output. Everything runs in your browser.

About this TOML formatter

This is a free online TOML formatter and validator. Paste a Cargo.toml, pyproject.toml, or any other TOML document into the input panel and you'll get a normalized, easy-to-read version back. Tables and arrays are grouped, key-value pairs are aligned, and any syntax error is reported with a clear message.

Features

  • Validate against the TOML 1.0.0 specification.
  • Sort keys alphabetically inside every table for a stable diff-friendly layout.
  • Preserve values, dates, and string types exactly as parsed.
  • Copy the result or download it as a .toml file.

How it works

The tool uses the open source smol-toml parser, loaded as an ES module on first use. It parses the document into structured data, optionally sorts keys, and serializes it back to canonical TOML.

Privacy

Your configuration never leaves your browser. The whole tool runs locally on this page, so you can safely paste production secrets, deploy manifests, or any other sensitive TOML without it touching a server.

Frequently asked questions

Does this tool send my TOML anywhere?
No. Parsing and formatting happen entirely in your browser. The smol-toml library is fetched once from a public CDN, but your document is never uploaded.
What version of TOML is supported?
TOML 1.0.0, including inline tables, arrays of tables, multi-line strings, dotted keys, and the full set of date and time types.
Will sorting keys change my values?
No. Sorting only reorders keys inside tables. Values, value types, and array order are preserved exactly. Inline-array order matters semantically in TOML, so arrays are never reordered.
Why is the output formatted differently from my input?
The serializer emits a single canonical layout (one key per line, consistent quoting, normalized escapes), which is what makes the result diff-friendly. Comments are not preserved because TOML parsers do not retain them.