T tomlkit·org
Inspect Formatter Validator Convert TOMLJSON JSONTOML TOMLYAML YAMLTOML INITOML TOMLINI .envTOML TOML.env TOMLTS Transform Sort keys Flatten Minify Compare Diff Merge

TOML Minifier

updated 25 May 2026

Re-emit a TOML document in its most compact form. Tables become inline where possible, blank lines disappear, arrays tighten. The parsed value tree is unchanged.

comments are dropped on re-emit

When to minify

Minifying TOML is unusual — the format is human-first, so most files don't need to be small. The valid use cases are:

  • Embedding TOML in HTTP headers, comments, or short fields. Inline tables and trimmed whitespace help fit a config under a length limit.
  • Snapshot testing. A canonical compact form makes byte-level comparison reliable across editors.
  • Diff-friendly storage. Some workflows prefer one-line-per-key inline tables for grepping.

How to use it

  1. Paste TOML on the left.
  2. Pick whether tables should inline when they're leaf-only (default), always inline, or stay as block headers.
  3. Copy or download the result.

FAQ

Is the output still valid TOML 1.0?

Yes. Inline tables and inline arrays are standard TOML syntax. Round-tripping through a parser produces the same value tree.

What about comments?

Stripped — re-emission goes through the parsed tree. If you want to preserve comments, keep the original file as the source of truth.

Difference from the formatter?

The formatter aims for human-readable canonical output. The minifier aims for the most compact valid output.